【发布时间】:2010-10-16 16:09:53
【问题描述】:
我想在用户禁用 javascript 时显示 noscript 警告,就像 StackOverflow 一样。
我使用这个 html:
<noscript>
<div id="noscript-warning">
Este sitio funciona mejor con JavaScript habilitado. Descubrí
<a href="">cómo habilitarlo.</a>
</div>
</noscript>
还有这个css:
#noscript-warning
{
font-family: Arial,Helvetica,sans-serif;
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 101;
text-align: center;
font-weight: bold;
font-size: 12pt;
color: white;
background-color: #AE0000;
padding: 10px 0;
display: block;
}
#noscript-warning a
{
color: #FFFFC6;
}
#container
{
width: 98%;
margin: auto;
padding: auto;
background-color: #fff;
color: black;
border-style: solid;
border-color: #3E4F4F;
border-width: 1px 2px 2px 1px;
line-height: 130%;
}
#container 是我的模板的主要内容元素。
当noscript标签可见时,它会出现在一些内容的前面。我不想这样,内容应该显示在警告下方。
我该怎么做?
【问题讨论】:
标签: css