Web page Production Knowledge Summary: CSS Common tips

Source: Internet
Author: User
Tags definition

The UL label in Mozilla defaults to have the padding value, but in IE only margin has the value.

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 is duplicated, the ID selector is valid because the ID has a higher weight than class.

A stupid way to adjust compatibility (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;}

If you need some spacing between a set of tags that you want to nest, leave the margin attribute in the tag that is inside, rather than defining the label on the outside padding

The icon in front of the Li label recommends using Background-image instead of list-style-image.

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

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

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

To define the four states of a link note the order: Link visited Hover Active

Content-Independent Pictures please use the background

The definition color can be abbreviated #8899ff = #89F

In some ways, table is much better than other labels. Use it where you want the column to be aligned.

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.