我有一個橙色背景的消息div,當有人註銷時在屏幕上列出了一條消息,但由於某種原因它在它之前吃了div,所以它們都在同一個盒子裏。是什麼賦予了?我一直在看,但無法弄清楚發生了什麼。爲什麼我的div在它之前吞下那個?
鏈接:http://goodpricescome.com?logout=1
代碼很簡單:
<div id="motto">A website for those who wait</div>
<?php if ($error) echo "<div class='error'>$error</div>"; ?>
<?php if ($warning) echo "<div class='warning'>$warning</div>"; ?>
樣式表:
#motto {
font-size : 20px;
font-weight : bold;
margin-top : 20px;
font-family : Shadows Into Light Two,Sans-Serif;
text-align : center;
position : static;
width : 100%;
margin-bottom : 35px;
}
.warning, .error {
width : 500px;
margin-bottom : 15px;
}
表明您已經定義了'浮動:左;''爲#motto'在891行' styles.css'。 – bansi
將'clear:left;'添加到'.warning,.error' –
謝謝!我只是沒有看到它。 –