CSS Tips Collection-Classic Classic

Source: Internet
Author: User

CSS skills in everyone's memory a little bit of it, in this article is to introduce the classic classic, if you absolutely will not be classic, then please don't miss Ha

 

Delete a dashed box on a link

Copy Code code as follows:


a:active, A:focus {


Outline:none;


}


Firefox defaults to the link when the focus (or click) plus a dotted box, use the above properties can be deleted.

The simplest CSS reset

Copy Code code as follows:


* {


margin:0; padding:0


}


Do not allow links to be broken lines

Copy Code code as follows:


a {


White-space:nowrap;


}


The above settings can avoid the link folding line, but personal advice long link will have the corresponding line (for the discussion of line-wrapping, see the center of the record).

Always have Firefox show scroll bars

Copy Code code as follows:


HTML {


overflow:-moz-scrollbars-vertical;


}


More Mozilla/firefox private CSS properties can be referenced here. Cross-browser support is required, or you can use the

Copy Code code as follows:


body, HTML {


min-height:101%;


}


Use Line-height to center vertically

line-height:24px;

If you use a fixed-width container and you want a row to be centered vertically, you can use Line-height (which is the same height as the parent container), and more vertically centered summaries are here.

Clear Container Float

Copy Code code as follows:


#main {


Overflow:hidden;


}


Center The Block element horizontally
margin:0 Auto;
is actually

Copy Code code as follows:


Margin-left:auto;


Margin-right:auto;


This technique basically all CSS textbooks will have instructions, don't forget to add a width to it. Exploer can also be used under

Copy Code code as follows:


body{


Text-align:center;


}


Then define the inner layer container

Text-align:left;

Recovery.

Hide scroll bars for exploer textarea

Copy Code code as follows:


TextArea {


Overflow:auto;


}


Exploer By default textarea will have a vertical scroll bar (don't ask me why).

Set up print paging

Copy CodeThe code is as follows:


H2 {


page-break-before:always;


}


The Page-break-before property enables you to set pagination when you print a Web page.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.