2015-02-10 84 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

我会使用标签将它们分开,这样当您想添加更多链接时,您总是会在左侧添加一个空格。