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 line of vertical residence is required. For more vertical center summaries, see here.
Clear container float
# Main {
Overflow: hidden;
}
This problem was also mentioned before. For more information, see here.
Do not fold links
A {
White-space: nowrap;
}
The above settings can avoid link folding, but I personally suggest that the long link have a corresponding line (for details about the line feed, refer to the record of the center ).
Always display the scroll bar in Firefox
HTML {
Overflow:-moz-scrollbars-vertical;
}
For more Mozilla/Firefox private CSS attributes, refer to here. Cross-browser support is required.
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
*{
Margin: 0; padding: 0
}
If you want to "complex", refer to the Yui practice (and here ). Some users have also expressed their views in the original text message.
I have to agree with Niall Doherty, * {margin: 0px; padding: 0px ;}
Basically means "traverse every CSS element and give it these
Attributes ". That is a very unnecessary strain on the server and
A bad semantic practice, as you have to give some elements
Padding/margin again, after stripping them.