właśnie zastanawiam się czy robię to poprawnie w tym linku mam http://jyf3e7434b3d.nazwa.pl/test/szablon.html szablon strony jaki sobie tworzę:
kod HTML
Kod
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="Script.js"></script>
</head>
<body>
<div id="header">
<div id="menu">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About Us</a></li>
</ul>
</div>
</div>
<div id="page">
<div id="content">
<p>Services like shopify.com , volusion.com or ntuit.com are letting you sell as long as you pay a monthly fee for using their platform. We develope and design a custom store which you own and have full rights to.</p>
</div>
</div>
<div id="footer">
</div>
</body>
</html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="Script.js"></script>
</head>
<body>
<div id="header">
<div id="menu">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About Us</a></li>
</ul>
</div>
</div>
<div id="page">
<div id="content">
<p>Services like shopify.com , volusion.com or ntuit.com are letting you sell as long as you pay a monthly fee for using their platform. We develope and design a custom store which you own and have full rights to.</p>
</div>
</div>
<div id="footer">
</div>
</body>
</html>
kod CSS
Kod
body {margin:0;}
#header {background-color: pink; width: 1000px; height: 100px; margin: 0 auto;}
#menu ul {list-style:none;margin:0;padding:0;}
#menu li {float:left;}
#page {background-color:orange;width:1000px;height:auto;margin: 0 auto;}
#content {width: 200px; height:auto;float:left;}
#footer {background-color: green; width: 1000px; height: 100px; margin: 0 auto;}
#header {background-color: pink; width: 1000px; height: 100px; margin: 0 auto;}
#menu ul {list-style:none;margin:0;padding:0;}
#menu li {float:left;}
#page {background-color:orange;width:1000px;height:auto;margin: 0 auto;}
#content {width: 200px; height:auto;float:left;}
#footer {background-color: green; width: 1000px; height: 100px; margin: 0 auto;}
Chodzi o kontener "page", ponieważ w obecnej chwili go nie widać.
Dodałem do #content styl float:left; i #page po odświeżeniu stronki zniknął.
Mogę to rozwiązać w ten sposób dodać do #page overflow:auto;
Pytanie czy będzie poprawnie i jak wy rozwiązujecie ten typu problem.