我有以下的CSS爲我的錯誤的div:Div只在Firefox中不可見?
.side_error {
width: 325px;
position: absolute;
top: 0;
left: -335px;
padding: 8px 0 0 0;
text-align: right;
color: #FF0000;
display: block;
}
和我的表TD下面的CSS:
.main_form td {
padding: 5px 0 5px 0;
position: relative;
}
而我的HTML結構:
<table class="main_form" align="center">
<tbody>
<tr><td class="title_area"><h2>Create an account</h2><span>(or <a href="#">Sign In</a>)</span></td></tr>
<tr><td><div class="side_error">please enter your full name >></div><input type="text" name="fullname" placeholder="Full Name" class="input"></td></tr>
<tr><td><input type="text" name="email" placeholder="Email" class="input"></td></tr>
<tr><td><input type="password" name="pass1" placeholder="Password" class="input"></td></tr>
<tr><td><input type="password" name="pass2" placeholder="Repeat Password" class="input"></td></tr>
<tr><td class="submit_area"><span><input type="checkbox" name="terms" value="yes" id="rm"><label for="rm"> I agree to <a href="#">**** Terms</a>.</label></span><input type="submit" name="submit" class="submit" value="Create Account"></td></tr>
</tbody>
</table>
與股利類side_error
似乎出現在每個瀏覽器中,究竟是如何我想要它,但在Firefox(版本17.0.1)它根本不顯示,即使我使用Firebug div div當懸停HTML代碼時,它不會變色,就像它根本不存在一樣。
任何想法?
嘗試刪除左:-335px ;? –
通過刪除「左」的div現在出現在表外,這是完全錯誤的,任何想法爲什麼我只有在Firefox中遇到麻煩? – Eric
似乎Firefox是唯一一個尊重規範在這裏。如果你的元素是position:absolute,並且你設置了left:negative_value,那麼它將被放置在視口之外。 –