Vertical center using line-height
line-height:24px;
Use line-height (the height is the same as that of the parent-layer container) when a fixed-width container is used and a vertical row is needed)
Clear container float
#main { overflow:hidden; }
Do not fold links
a { white-space:nowrap; }
The above settings can avoid link folding
Always display the scroll bar in Firefox
html { overflow:-moz-scrollbars-vertical; }
body, html { min-height:101%; }
Horizontally center block elements
margin:0 auto;
Actually
margin-left: auto; margin-right: auto;
Basically, all CSS textbooks will illustrate this technique. Don't forget to add a width to it. Exploer can also be used
body{ text-align: center; }
Then define the inner container
text-align: left;
Restore.
Hide the scroll bar of exploer textarea
textarea { overflow:auto; }
By default, exploer has a vertical scroll bar in textarea (don't ask me why ).
Set print pages
h2 { page-break-before:always; }
The page-break-before attribute can be used to set the page for printing a webpage.
Delete the dotted box on the Link
a:active, a:focus { outline:none; }
By default, Firefox adds a dotted box to the link to get the focus (or click it). The above attributes can be deleted.
Simplest CSS Reset
Java code
- * {Margin: 0; padding: 0}