> 웹 프론트엔드 > HTML 튜토리얼 > html块之间换行_html/css_WEB-ITnose

html块之间换行_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
풀어 주다: 2016-06-24 12:15:16
원래의
1051명이 탐색했습니다.

<!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;
删除


clear:both;
删除
跪了,我怎么没试这个呢…谢谢红钻大哥。

관련 라벨:
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿