Description of failure to parse float and list image list-style-image in CSS

Source: Internet
Author: User

IE6, 7 (not tested in other versions): When float and list-style-image in CSS are executed simultaneously, list-style-image cannot be executed normally.Code.

In general, use background-image + background-repeat to solve the problem correctly.

For example, the following code is theoretically correct, but cannot produce correct results.

.Info Li{

List-Style-Image:URL(/Images/OK.GIF);

Margin:0px 0 12px 5px;

Width:280px;

Float:Left;

Padding-Left:20px;

}

This also confirms that when everything is normal, it is the most prone to errors.

Use background-image to replace the above Code. The reference code is as follows:

.Info Li{

Background-Image:URL(../Images/OK.GIF);

Background-Repeat:No-Repeat;

Margin:0px 0 12px 5px;

Width:280px;

Float:Left;

Padding-Left:20px;

}

I don't know if there is any better way to solve this problem, but I have only done so now. Please let me know if there is a better way.

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.