IE9 / CSS / 背景颜色 / 填充问题
IE9 / CSS / background color / padding issue
我对 IE9 和 css 有疑问。看起来 IE9 不接受 p 和 a 这两个元素的填充定义。背景颜色缩小,只出现在元素的左上角。尽管以下 css 在 firefox 中工作正常:
<div class="slider">
<p class="claim orange">Some Text</p>
<a class="claim blue" href="">Some Link</a>
</div>
<style type="text/css">
.slider p {
position: absolute;
top: -200px;
z-index: 8000;
padding: 0.5% 2%;
line-height: 100%;
color: #fff;
white-space: nowrap;
text-transform: uppercase;
}
.claim {
line-height: 100%;
font-size: 18px;
}
.orange { background: #EF7D00 }
.blue {
color: white;
font-weight: bold;
padding: 10px 15px;
border-color: white;
}
.blue:hover {
color: white;
font-weight: bold;
padding: 10px 15px;
background: #2e6da4;
border-color: #2e6da4;
text-decoration: none;
}
</style>
可能是什么问题?在这种情况下,我怎样才能使 IE9 中的背景颜色正常工作?
您的代码原样似乎无法显示工作页面,至少对我来说 Chrome 或 Firefox。包含 "some text" 的 p 元素显示为顶部:-200px,离开页面到顶部,背景是白色的,所以在我将鼠标悬停在 link.[=10= 上之前我看不到任何东西]
您是否忘记在代码中包含一些关键行?尝试将所有内容粘贴到文本文件中并进行测试,然后再将其上传到问题中,否则我们将很难为您提供帮助。
我不清楚你想在这里做什么!
我对 IE9 和 css 有疑问。看起来 IE9 不接受 p 和 a 这两个元素的填充定义。背景颜色缩小,只出现在元素的左上角。尽管以下 css 在 firefox 中工作正常:
<div class="slider">
<p class="claim orange">Some Text</p>
<a class="claim blue" href="">Some Link</a>
</div>
<style type="text/css">
.slider p {
position: absolute;
top: -200px;
z-index: 8000;
padding: 0.5% 2%;
line-height: 100%;
color: #fff;
white-space: nowrap;
text-transform: uppercase;
}
.claim {
line-height: 100%;
font-size: 18px;
}
.orange { background: #EF7D00 }
.blue {
color: white;
font-weight: bold;
padding: 10px 15px;
border-color: white;
}
.blue:hover {
color: white;
font-weight: bold;
padding: 10px 15px;
background: #2e6da4;
border-color: #2e6da4;
text-decoration: none;
}
</style>
可能是什么问题?在这种情况下,我怎样才能使 IE9 中的背景颜色正常工作?
您的代码原样似乎无法显示工作页面,至少对我来说 Chrome 或 Firefox。包含 "some text" 的 p 元素显示为顶部:-200px,离开页面到顶部,背景是白色的,所以在我将鼠标悬停在 link.[=10= 上之前我看不到任何东西]
您是否忘记在代码中包含一些关键行?尝试将所有内容粘贴到文本文件中并进行测试,然后再将其上传到问题中,否则我们将很难为您提供帮助。
我不清楚你想在这里做什么!