A strange bug in border-width of the image control in ASP. NET

Source: Internet
Author: User
Today, I developed a page for the image list. There are many. Net image controls on this page. The following is used when I use CSS to control this IMG: Code :

. Goodslist Li a IMG {border: 1px solid # CCC; Height: 100px; width: 100px}

At this time, a strange thing happened: the browser does not display the image border.

Check the CSS code page carefully.Source codeThe IMG has one more attribute in HTML:

 

Style = "border-width: 0px ;"

 

After searching on the Internet, it is found that this is A. Net Control bug, but the solution on the internet is complicated. Then I searched for an English website and found a simple method. I can change the above CSS code:

. Goodslist Li a IMG {border: 1px solid # CCC! Important; Height: 100px; width: 100px}

It is released and displayed normally.

About! Important

! Important is protected. inserting impant ant after any attribute to be protected can avoid being overwritten by feature-based attributes. Example: # nav A {color: red;} A {color: Teal! Important}. Generally, a link in an element with an ID name # nav will change to a bit red, because # nav A is more specific than the label style, but it contains! Important thinks this attribute will always win.

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.