Change element display
Table-related, list-list-item values are not discussed. discussed later.
Change the display role
Display as block-level elements
Change a string of links (inline elements) vertically, if there are a series of links:
<div id= "Navigation" >
<a href= "index.html" >widgetco home</a><a href= "products.html" >Products</a>
<a href= "services.html" >services</a><a href= "fun.html" >widgety fun!</a>
<a href= "support.html" >support</a><a href= "about.html" id= "current" >about Us</a>
<a href= "contact.html" >Contact</a>
</div>
Can be placed in a table, or each wrap a div, or you can make them into block-level elements, like this:
Div#navigation a {display:block;}
Browsers that do not support CSS can display a vertical navigation effect by doing so. Displayed as blocks, you can set the style like block-level elements, this way the entire box becomes a link, if the mouse moved to the box, you can click.
****
Display as inline element
Let an unordered list be placed horizontally.
<ul id= "Rollcall" >
<li>bob c.</li>
<li>marcio g.</li>
<li>eric m.</li>
<li>kat m.</li>
<li>tristan n.</li>
<li>arun r.</li>
<li>doron r.</li>
<li>susie w.</li>
</ul>
#rollcall li {display:inline; border-right:1px solid; padding:0 0.33em;}
#rollcall Li:first-child {border-left:1px solid;}
It is worth noting that you changed the display character of the elements, but did not change their nature, in other words, a paragraph can be generated a row-level (inline-level) box (box), but the paragraph cannot be changed into a row-level element (inline-element). You can put inline elements into block-level elements, and vice versa. Otherwise, it would be ineffective.
**********
Inline block Element Inline-block
Inline block elements are formatted as if they were inline replaceable elements. As with replaceable elements, inline elements are defaulted to the text Baseline (baseline).
The block-level elements of the dashed box, respectively, are displayed as block-level, inline, and inline blocks.
Third, Inline-block makes the line taller, just like a replaceable element mentioned earlier.
The width of the inline box element, if undefined, is set to exactly include his content, as in the inline box (inline-box). However, Inline-block will not fold.
Inline block-level elements can be used to display a horizontal navigation bar. For example #navbar a {display:inline-block; width:20%;}
*********
Run-in elements
An element display:run-in, if followed by a block-level element, run-in will become the first inline box of this block-level element.
The run-in element browser is not supported and has not seen anyone else use it.
Calculated value
When an element floats or is positioned, the computed value of display can change.
If an element is absolutely positioned, float is set to none.
For absolute or floating elements, the computed value of the final display is determined by the declaration.
For the root element, declared as inline-table or table will get table, declaring none will get calculated value None, others are block.
CSS authoritative guide-Basic visual formatting 4