开发者

Anchor split into two pieces on IE7

Top: IE8

Bottom: IE7

Anchor split into two pieces on IE7

How do you fix IE7 so it doesn't split my anchor into two pieces? I know display:block and float:left would solve this, but I'd rather have it be inline. This way, I can have text both to the left and right of any arbitrarily placed anchor button.

    #launchChrome {
        font-weight: bold;
        text-decoration: none;
        text-shadow: 0 1px 0 rgba(255,255,255,1);
        background: #eee;
        background: -moz-linear-gradient(center top, #fff, #cfd5e3);
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #cfd5e3));
        border: 1px solid;
        border-color: #ccc #ccc #999 #ccc;
        -moz-border-radius: 0.4em;
        -webkit-border-radius: 0.4em;
        text-shadow: 0 1px 0 rgba(255,255,255,0.7);
        color: #666;
        font-size: 1.4em;
        padding: 0.2em 0.6em;
        margin: 0 0 0 1em;
        -moz-box-shadow: 0 0.1em 0.1em rgba(0,0,0,0.1);
        -webkit-box-shadow: 0 0.1em 0.1em rgba(0,0,0,0.1);
    }

<a id="launchChrome" href="javascript:void(0)" onclick="launch()">
            <img src="<?=base_url()?>images/spacer.g开发者_高级运维if" class="spriteChannel googleChromeSmall">
            Launch Chrome
        </a>


I used display:inline-block to fix it.


Why even use an image tag to begin with?

Use a non repeating background image and set a padding-left on the link so the text does cover the image.


First of all close your img tag <img />.

Second - try adding zoom:1 to #launchChrome - I'm not having the exact same render problem in IE7 but it fixed it's look in both IE6/7. That shoud trigger hasLayout.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜