Collect and organize common top-level CSS attributes

Source: Internet
Author: User

Align the two ends of the text: CopyCode The Code is as follows: Text-align: justify;
Text-justify: Inter-ideograph;

Clear floating:Copy codeThe Code is as follows:. Clear {clear: Both; line-Height: 0; Height: 0; font-size: 0 ;}

Clear floating pseudo classes:Copy codeThe Code is as follows:. Clearfix: After {content: "."; display: block; Height: 0; clear: Both; visibility: hidden ;}

Set not to disconnect wordsCopy codeThe Code is as follows: Word-break: Keep-all

Automatic character line feedCopy codeThe Code is as follows: Word-break: Keep-all; Word-break: Break-all; Word-wrap: Break-word

Vertical center using line-height

Copy code The Code is as follows: Line-Height: 24px;/* use a fixed-width container and use line-height (the height is the same as that of the parent-layer container) when a row is in vertical residence ), for more vertical center summary, see here.
*/

Clear container float

Copy code The Code is as follows: # Main {overflow: hidden ;}

Do not fold links

Copy code The Code is as follows: A {white-space: nowrap ;}

Always display the scroll bar in Firefox

Copy code The Code is as follows: HTML {overflow:-moz-scrollbars-vertical ;}

Horizontally center block elements

Copy code The Code is as follows: body, HTML {Min-Height: 101%;} or margin: 0 auto;

Hide the scroll bar of exploer textarea

Copy code Code: textarea {overflow: auto ;}

Set print pagesCopy codeThe Code is as follows: H2 {page-break-before: Always;}/* sets the page when the web page is printed */

Delete the dotted box on the LinkCopy codeThe Code is as follows: A, area {BLR: expression (this. onfocus = This. Blur ())}
: Focus {-moz-Outline-style: none ;}

Simplest CSS ResetCopy codeThe Code is as follows: * {margin: 0; padding: 0}/* This attribute is used with caution. Although it can eliminate the default attribute, it has an impact on browser rendering and is not good at semantic expression. */

Attribute required for text after image press ENTER

Copy code The Code is as follows: IMG {vertical-align: Top ;}

Transparent attributes

Copy code The Code is as follows: filter: alpha (opacity = 50);-moz-opacity: 0.5; opacity: 0.5;
Cursor: hand;

Move the mouse to the hand shapeCopy codeThe Code is as follows: cursor: hand;

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.