<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 8 年前。
我有这个 div,它的 id 在runtime 上生成,而 css 我有一个模板,它也会在运行时生成。这里的问题是它在 IE10 及更高版本中工作正常,但在 IE8 和 IE9 中某些 div 样式正在发生变化。假设我有 39 个 div,但正确的样式是仅适用于 27 个 div。
<loop>[for loop]
<div id="active<%count%>"> </div>
</loop>
<style>
#active<%count%>{
height: <%(count < 5 ? count * 4 + 32 : "120")%>px;
width: <%(count < 5 ? count * 8 + 32 : "80")%>px
}
</style>
以上代码用于创建div 和css。高度和宽度也在运行时生成,这只是一个示例数字。你们能帮我解决这个问题吗?我正在使用此 div 通过 ActiveWidgets 1.1
生成 GRID最终代码会是这样
<style>
#active28{
Height : 72px;
Width : 112px;
}
</style>
在查看源代码中工作和非工作都是一样的。
最佳答案
为什么不使用 class 来应用 CSS?
<loop>[for loop]
<div class="active"> </div>
</loop>
<style>
.active {
height: 752px;
width: 40px;
}
</style>
关于java - CSS 在 IE8、IE9 中不工作,但在 IE10 及更高版本中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25969484/
相关文章:
java - Quarkus 在@QuarkusTest 套件中没有@Inject beans
java - 无法使用 getImportedKeys() 或 getExportedKeys() 获取外键,只有 getPrimaryKeys() 有效
javascript - XmlHttpRequest.onload 在 Edge 浏览器中不起作用
javascript - Hybrid App - 使用 iPhone 数字键盘,我可以添加小数点吗?
javascript - Firefox 不在 iframe 中加载本地文件