1. Vertical center of block-level elements
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd "> <Html xmlns =" http://www.w3.org/1999/xhtml "Xml: lang =" en ">
Tip: the code can be modified before running!
Reference content is as follows: # Wrapper { Border: 1px solid # ccc; Width: 400px; Height: 200px; Text-align: center; Line-height: 200px; // Vertical Align For IE7 & Firefox _ Font-size: 120px; // Vertical Align For IE6 } # Wrapper { Display:-moz-inline-block; // For Firefox 2 (-) Display: inline-block; // For Firefox 3 & IE6. For IE6, it is actually equivalent to zoom: 1, just giving elem a layout. // Note: browsers that support display: inline-block include Firefox3, Safari, and Opera. Margin: 0 auto; // For Firefox 2 (-) Width: 80px; Height: 20px; Font: 11px/20px arial; Background: red; } |
- Four pages in total:
- Previous Page
- 1
- 2
- 3
- 4
- Next Page