A few common classic CSS tips _ Experience Exchange
Source: Internet
Author: User
Center vertically with Line-height
line-height:24px;
With a fixed-width container and one row vertically centered, use Line-height (the height is consistent with the parent container), and more vertical centers can be seen here.
Clear Container Float
#main {
Overflow:hidden;
}
Before the issue was mentioned, more information can be seen here.
Do not leave a link wrapped
A
White-space:nowrap;
}
The above setting avoids the link wrapping, but the individual suggests that the long link will have a corresponding line (for a discussion of line breaks, see the records in the center of the circle).
Always let Firefox show scroll bars
HTML {
overflow:-moz-scrollbars-vertical;
}
More Mozilla/firefox private CSS properties can be consulted here. Requires cross-browser support, or you can use the
Body, HTML {
min-height:101%;
}
Center The Block element horizontally
margin:0 Auto;
is actually
Margin-left:auto;
Margin-right:auto;
This technique basically all the CSS textbooks will have a description, don't forget to add a width to it. can also be used under Exploer
body{
Text-align:center;
}
Then define the inner layer container
Text-align:left;
Recovery.
Hide Exploer textarea scroll bar
TEXTAREA {
Overflow:auto;
}
Exploer By default textarea will have a vertical scroll bar (don't ask me why).
Set up print paging
H2 {
Page-break-before:always;
}
The Page-break-before property enables you to set pagination when a page is printed.
Delete a dashed box on a link
A:active, A:focus {
Outline:none;
}
Firefox defaults to a dotted box when the link gets focus (or when clicked), and can be deleted using the properties above.
The simplest CSS reset
* {
margin:0; padding:0
}
If you want to be "complex", refer to Yui's approach (and here). In the original message, there were users who said their views.
I have to agree with Niall Doherty, * {margin:0px; padding:0px;}
Basically means "traverse every CSS element and give it these
Attributes ". That's a very unnecessary strain on the server and
A bad semantic practice, as you had to give some elements
Padding/margin again, after stripping them.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.