Home >Web Front-end >HTML Tutorial >Line breaks between html blocks_html/css_WEB-ITnose

Line breaks between html blocks_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:15:16958browse

<!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>

I am new to HTML, so I don’t know if the question I am asking is too simple...
Here I want to know why the block with the ID of footer is automatically wrapped?
Main Tittle of Web Page is the first line, main and content are on the second line, why does the footer automatically change to the third line (I added the float:left; variable to the value)?


Reply to discussion (solution)

remove
clear:both;
delete

remove
clear:both;
Delete
I'm on my knees, why didn't I try this... Thank you, Brother Red Diamond.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn