CSS display inline properties and usage
The attribute of CSS display inline is used to define the elements to be displayed on the same line, that is, the image or text does not wrap. The corresponding usage is display block . We will do a detailed introduction in another article. If your text ( Often used in the title) If you don't want to wrap, you can use the display inline technique. Please see the following example.
CSS display inline syntax example 1. DIV block horizontal and horizontal
<div style="display:inline;">Element one</div><div style="display:inline;">Element two</div>
The example presents the results asAlso display: inline also may overflow with make some changes, such as when the title is too long, but do not want to wrap the display, you can use display: inline with overflow hidden skills (overflow: hidden) to achieve, which many large sites Skills commonly used in layout.
CSS display inline example 2: ul li horizontal
<!--
#B ul li {
display:inline;
}
-->
</style>
<div id="A">
<b>Original rendering</b>
<ul >
<li>Here is project one</li>
<li>Here is project two</li>
</ul>
</div>
<div id="B">
<b>Horizontal and horizontal rendering</b>
< ul>
<li>This is project one</li>
<li>This is project two</li>
</ul>
</div>
●Here is item 1
●Here is item 2
Horizontally presented
Here is item 1Here is item 2
Post a Comment
0 Comments