css - 需要一些帮助解决 IE8 中的 css 问题吗?

标签 css xhtml internet-explorer-8

大家好,我的样式表(即 ie 8)存在一些跨浏览器问题。

下面的 css 在我的 chrome/ff 样式表中工作正常,但它对我的 ie 样式表根本不起作用。

#threetwoBTN {
background-repeat: no-repeat;
background-image: url('../images/32Button_BG01.png');
}
a#threetwoBTN:hover {
background-repeat: no-repeat;
background-image: url('../images/32Button_BG02.png');
}

在 IE 中,下面是我所能得到的。

#threetwoBTN {
background-repeat: no-repeat;
background-image: url('../images/32Button_BG01.png');
}

我可以应用我的背景图片,仅此而已,我想要的悬停效果在 IE8 上根本不起作用。以下是我的标签的结构:

    <div class="ContentBody">
    <div class="LeftContentBody">
        <br/>
            <!-- another div but ignored for example! -->
        <br />
        <a id="threetwoBTN">Download 32-Bit</a>
        <p>
            * ...
        </p>

为每个“a”标签设置的 id 允许我按照希望的方式定位和设置每个 anchor 的样式,因为每个标签都有不同的背景和效果等。有人可以帮我解释一下这个与 IE 相关的问题吗?

更新:


文本在页面之外缩进,因此用户看不到 anchor 标记之间的文本。这意味着按钮仅由背景图像组成。为清楚起见,我已将我用来设置 anchor 标记样式的 css 粘贴在下方。

.LeftContentBody a {
font-size: 10px;
text-indent: -1500px;
width: 124px;
height: 62px;
border: 2px solid #000000;
margin-left: 32px;
margin-bottom: 32px;
float: left;
clear: left;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}

最佳答案

你应该将属性 href 添加到你的标签中,尝试使用 #,它应该可以工作,至少它对我有用。

希望对您有所帮助。

#threetwoBTN 
{ 
    background: #CCC;     
} 
#threetwoBTN:hover {
    background: #AAA;
}

<div class="ContentBody">     
<div class="LeftContentBody">         
    <br/>            
     <!-- another div but ignored for example! -->         
    <br />        
    <a href="#" id="threetwoBTN">Download 32-Bit</a>         
    <p>* ...</p> 
</div>
</div>

关于css - 需要一些帮助解决 IE8 中的 css 问题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5733801/

相关文章:

ruby - 使用 Sinatra 提供 XHTML

javascript - IE8 中可能存在 jQuery/jqGrid 问题

css - 如何在 Bootstrap 4 中定位轮播指示器

css - bootstrap - 按钮组 - 按钮在左侧被切断

jquery - 在移动屏幕上调整窗口大小后的空白矩形

html - Internet Explorer CSS header 问题

css - 为什么 IE8 版本 "8.0.7601.17514 CO"的行为类似于 IE7?

html - 没有让 SCSS 正常工作? (代码更新)

javascript - 如何使用 jquery 将多个按钮 id 复制到剪贴板

xhtml - 如何制作一个 CSS Sprite 来控制多个 DIV 的多个背景图像?