2013-10-06 183 views
1

我有以下HTMLCSS,其中徽標浮在左側,但我希望能夠將內容浮在右側。左側浮標和右側內容

<html> 
    <body> 
    <div id="logo"> 
     <img src="images/logo.gif" height="376" width="198" alt="LOGO" title="" /> 
    </div> 
    <div id="maintext"> 
     <p id="main">First paragraph</p> 
     <p>Second paragraph.</p> 
    </div> 
    <footer>...</footer> 
    </body> 
</html> 

在我的CSS,爲logo選擇是:

#logo { 
    display: block; 
    float: left; 
} 

#maintext { 
    padding: 0 0.5em 0 0.5em; 
} 

發生了什麼事是,標識「images/logo.gif」最多顯示的,但在頁腳的頂部的左側。它應該顯示在「主文本」選擇器的左側。

任何想法?

回答

2

添加這個CSS:

footer { 
    clear: both; 
} 
+0

是工程。謝謝。 – mythoslife

0

我不太瞭解......這將是:

float: right; 
+0

對不起......很明顯:兩者; – mythoslife

+0

owwww。 okeeey :) – VVL