Experience Sharing: Web page Technology CSS style sheet page layout experience

Source: Internet
Author: User
Tags define definition relative
css| Page | style sheet

1. Tags in mozilla default is padding value, and in IE only margin have a value.

2. The same class selector can appear repeatedly in one document, but only once for the ID selector, and for a label using both class and ID for CSS definition, and if the definition has duplicates, the ID selector does the definition effectively.

3. A clumsy approach to compatibility adjustment (ie and Mozilla):

Beginners may encounter such a situation: the same label properties in IE set to a display is normal, and in Mozilla must be set to B to normal display, or two of the upside.

Temporary workaround:

Selector {property name: B!important; property name: A;}

4. If a group of tags to be nested between the need for some spacing, then leave the tag in the inside of the margin attribute bar, and do not define the outside of the label padding

The icon in front of the 5.li label recommends using Background-image instead of List-style-image

6.IE the difference between inheritance and parent-child relationships, all of which are inherited relationships.

7. When you give your label crazy plus selector, don't forget to add a comment to the selector in the CSS. When you change your CSS later on, you'll know why you're doing it.

8. If you give a label a deep tonal background picture and a bright tonal text effect. It is recommended that you set a background color for your labels at this time.

9. Define the four states of the link to note the order: Link visited Hover Active

10. For content-independent pictures please use background

11. Define colors can be abbreviated #8899ff = #89F

12.table is much better in some ways than other labels. Please use it where you want to align the columns

13.<script> does not language this attribute, it should be written like this:
<script type= "Text/javascript" >

14. Title is the title, the title of the text is the title of the text. Sometimes the title does not necessarily need to display text, so:

15. The perfect Tan Shansu outer frame Line form

Table {border-collapse:collapse;}
td {border: #000 solid 1px;}

16.margin negative values can be used when the label use absolute positioning of the role of relative positioning, when the page is displayed in the center, the use of absolute positioning of the layer is not suitable to use the Left:xxpx attribute. It's a good way to put this layer next to a label to be positioned relative to it, and then use the negative

17. Absolute positioning with the use of margin value positioning can be relative to the location of their own, this and top,left and other attributes relative to the window edge positioning is different. The advantage of absolute positioning is that it allows other elements to ignore its presence.

18. In English and Chinese at the end of the alignment style (ie6,ie5 in English through, the FF failure)
text-align:justify;
Text-justify:inter-ideograph;



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.