【发布时间】:2015-11-09 21:41:46
【问题描述】:
我在锚标签中有一个 img 标签。 ancher 标签位于 div 标签内。我正在使用 img 标签的 alt 属性。 alt 属性的值是长度为 68 个字符的文本。我的问题是 alt 属性值(文本)超出了 div 并且隐藏在 IE 中。我的意思是在显示几个字符后,通常其余字符会被隐藏或裁剪。这是我的html代码sn-p。
<div class="products">
<div class="prod-image" id="catEntryImage">
<div class="prodClass" id=WCCE>
<a><img alt="some text total around 70 character" src="someURL"/></a>
<P class=gasCode></P>
</div>
</div>
<div class="prod-content"></div>
<script type="text/javaScript"></script>
</div>
给定 html sn-p 的 CSS
div {
line-height: 1.4em;
word-break: break-all;
position: relative;
margin: 0;
padding: 0;
border: 0;
font-family: arial, helvetica, sans-serif;
font-size: 100%;
}
img {
text-decoration: none;
border:0;
}
a {
color: #e10014;
text-decoration: none;
font-size: 1.2em;
}
.products .prod-image {
width: 135px;
float: left;
margin-right: 20px;
margin-bottom: 20px;
text-align: center;
vertical-align: bottom;
overflow: hidden;
max-height: 250px;
overflow: hidden;
}
.products .prod-content {
width: 288px;
float: left;
margin-bottom: 20px;
text-align: left;
vertical-align: bottom;
}
我将 word-wrap & line-break css 属性应用于图像的 alt 属性,但它也不起作用。任何机构都可以帮助我吗?这仅在 IE 中发生。如果我对 img 标签使用“word-break: break-all”css 属性,它在 chrome 中可以正常工作,但在 IE 中不起作用。
【问题讨论】:
-
能否请您在此处提供html代码..以便我们更好地识别您的问题。
-
我上面已经提供了html & css sn-p。
-
IE在IE11和IE10上工作正常。 -
@vivekkupadhyay 它的 IE 11。请现在检查我已经更新了上面的完整 html sn-p 结构。
标签: html css internet-explorer dojo