简体   繁体   中英

CSS Problem in IE7

I am using asp:button for my asp.net project. I wrote one css Class. It perfectly apply Css style and show image in the asp:button.
It is working fine in FF, Safari and IE8. But the Css Class does not work in IE7, How to solve? and my Code is:

.likeImage {
    background-image:url('images/LikeNew.png');
    background-repeat:no-repeat;
    background-position:top left;
    width:65px;
    height:24px;
    cursor:default;
    text-align:left;
    padding-left:5px;
    margin:0px;
    padding:0px;
}

You used (padding-left:5px;) and (padding:0) this is not the right way. just use

padding:5px;

Then please check.

Add border:0; in your CSS for asp:button .

尝试这个 :

padding: 0 0 0 5px; 

Internet Explorer calculates padding towards inside of a block, while other browsers calculates padding towards outside of a block.

In IE, Actual Width = CSS width .

Others, Actual Width = CSS width + Left Padding + Right Padding .

The second one is standard CSS approved by W3C.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM