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
}