首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

html块其间换行

2012-10-12 
html块之间换行HTML code!DOCTYPE htmlhtmlbodydiv idcontainer stylewidth:1200pxdiv id

html块之间换行

HTML code
<!DOCTYPE html><html><body><div id="container" style="width:1200px"><div id="header" style="background-color: #FFA500;"><h1 style="margin-bottom:0;">Main Tittle of Web Page</h1></div><div id="menu" style="background-color: ##FFD700; height:200px; width:100px; float:left;"><b>Menu</b> <br/> <!--"b emphasizes the text"-->HTML<br/>CSS<br/>JavaScirpt</div><div id="content" style="background-color:#EEEEEE; height:200px; width:400px; float:left;">Content goes here</div><div id="footer" style="background-color:#FFA500; clear:both;text-align:center; float:left; ">Copyright @ W3Schools.com <br/><a href="http://www.w3schools.com/html/html_layout.asp" target="_blank">http://www.w3schools.com/html/html_layout.asp</a></div></div></body></html>

初学html,不知道问的问题是不是很小白……
这里我想知道id为footer的块为什么自动换行了?
Main Tittle of Web Page是第一行,main和content在第二行,footer为什么自动换到第三行去了(我在值里加上了float:left;变量)?


[解决办法]

clear:both;
删除

热点排行
Bad Request.