使用以下標記,我創建了一個具有兩個浮動文本疊加層的圖像,一個用於標題,另一個用於摘要文本。這是呈現我希望的方式,並且我可以使用整個圖像以及標題&摘要來訪問鏈接,除了'標題'右側直到'摘要'末尾的區域。這發生在所有瀏覽器(IE9和更低版本除外)。任何想法爲什麼以及如何解決它?防止懸停的CSS內聯元素
HTML:
<div class="image">
<a href="Default.aspx"><img src="Assets/Images/Picture.jpg" alt="Picture" /></a>
<div class="overlay">
<a href="Default.aspx" class="headline">Headline</a>
<a href="Default.aspx" class="summary">Summo eirmod appareat ex mel. Vim odio error labores ex. Mea alii abhorreant et. Ad has nominati constituam. Sit falli nominati suavitate in.</a>
</div>
</div>
CSS:
body {
border: 0;
color: #5B6064;
font-family: Helvetica, Arial, Sans-Serif;
font-size: .75em;
line-height: 1.6em;
margin: 0;
padding: 0;
background-color: #a5a5a5;
}
a {
text-decoration: none;
color: #5B6064;
}
a:visited {
text-decoration: none;
}
img {
border: 0;
}
.image {
position: relative;
width: 100%;
/* For IE6 */
display: block;
overflow: hidden;
}
.overlay {
position: absolute;
bottom: 10px;
left: 0;
display: block;
}
.headline {
color: #FFF;
font: bold 24px/45px Helvetica, Sans-Serif;
letter-spacing: -1px;
background: #e87b10;
/* Fallback for older browsers */
background: rgba(232,123,16,0.8);
padding: 10px;
float: left;
clear: left;
}
.summary {
max-width: 350px;
margin-top: 3px;
color: #FFF;
font: 14px/14px Helvetica, Sans-Serif;
letter-spacing: 0;
background: #e87b10;
/* Fallback for older browsers */
background: rgba(232,123,16,0.8);
padding: 10px;
float: left;
clear: left;
}
.summary a {
color: #FFF;
}
你的CSS沒有懸停事件,它是否缺少? – 2012-03-13 19:53:28