Style Sheet CSS layout experience _ CSS/HTML

Source: Internet
Author: User
Style Sheet CSS layout experience will be added or modified with the accumulation of time. I hope the following things will be helpful or useless to standard learners.

The main content is the differences between IE and MOZILLA and the details that are easy to ignore. The best implementation methods of some classic applications should avoid the violation errors.

Due to the accumulation of your usual experience, some incorrect explanations are inevitable. If you are lucky enough to be seen by others, please be sure to point it out and thank you first.

Ul labels have padding values by default in Mozilla, while only margin has values in IE.

The same class selector can be repeated in a document, but the id selector can only appear once. CSS is used for defining a label with both class and id. if the definition is repeated, the definition of id selector is valid.

A stupid way to adjust compatibility (IE and Mozilla:

A beginner may encounter this situation: it is normal to set the attribute of the same tag to A for display in IE, and B for display in Mozilla, or two for display.

Temporary solution:

Selector {property name: B! Important; attribute name: ;}

If some spacing is required between a group of labels to be nested, leave it to the margin attribute of the label located inside, instead of defining the padding of the label located outside.

We recommend that you use background-image instead of list-style-image for the icon before the li label.

IE cannot tell the differences between the inheritance relationship and the parent-child relationship. All are inheritance relationships.

Don't forget to add a comment to the selection character in CSS when adding a keyword to your tag. You will know why to do so when you modify your CSS later.

If you have set a deep background image and a bright text effect for a label, we recommend that you set a deep background color for the label at this time.

Pay attention to the order of the four states of the Link: Link Visited Hover Active

Use background for images unrelated to content

Color can be abbreviated as # 8899FF = # 89F

Table performs better in some ways than other labels. Use it where column alignment is required.

Script does not have the language attribute. It should be written as follows:

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: 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.