2015-02-10 64 views
0

我有一個我寫的小項目。目標是在網站左側有一個部分顯示到其他網站的鏈接。到目前爲止,我已經將與「段落」標籤相同行上的「鏈接」的h3放入。獲取h3鏈接

我想要的是將「google」的鏈接放在標有「鏈接」的h3標籤下方。現在它在h3標籤之上。

下面是代碼:

<html> 
<head> 
<title>Link practice</title> 

<link rel = "stylesheet" href = "style.css"/> 

<h1>Welcome to my links</h1> 

<p id = "paragraph"> Hello there! To the left you  can find links to other websites</p> 

<h3 id = "h3">Links:</h3> 

<ul id = "ul"> 
<li id = "li"> 
<a id = "a" href =  "http://www.google.com">google</a> 
</li> 
</ul> 

</body 
</html> 

這裏是樣式表(style.css文件)

body 
{ 
background: lightgreen; 
} 

a:hover 
{ 
color: white; 
background: darkgreen; 
} 

h1 
{ 
text-align: center; 
} 

#h3 
{ 
float: left; 
} 


#paragraph 
{ 
float: right; 
margin-right: 300px; 
} 

謝謝!

回答

0

我會使用標籤將它們分開,這樣當您想添加更多鏈接時,您總是會在左側添加一個空格。