HTML:
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>Basis-frans.nl | Home</title>
</head>
<body>
<div id="content">
<div id="header">
<div id="inheader">
<div id="logo">
</div>
<div id="navmenu">
</div>
<div id="slogan">
</div>
</div><!-- end #inheader -->
</div><!-- end #header -->
<div id="body">
</div>
</div> <!-- end #content -->
</body>
</html>
Code:
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
body {
margin: 0;
background: #999;
}
p {
margin: 0;
}
#content {
margin: 10px auto;
width: 70%;
height: 1000px;
background: #999;
}
#header {
margin: 0;
background: #fff;
height: 225px;
width: 100%;
float: left;
}
#inheader {
margin-left: 2%;
margin-right: 2%;
margin-top: 20px;
margin-bottom: 20px;
height: 180px;
width: 95%;
background: #000;
float: left;
}
#logo {
margin-top: 35px;
background: #fff;
width: 15%;
height: 100px;
float: left;
}
#navmenu {
margin-left: 40%;
margin-top: 30px;
width: 50%;
height: 50px;
background: #fff;
}
#slogan {
margin-top: 30px;
margin-left: 30%;
width: 40%;
height: 50px;
background: #fff;
}
#body {
margin-top: 200px;
height: 700px;
width: 100%;
background: #000;
}
Dit is een HTML en een CSS bestand.
Ik wil dat mijn #body 200px van mijn #header af komt te staan, maar als ik margin-top: 200px; invul bij #Body dan gaat heel de #content 200px van de top, hoe zorg ik ervoor dat de #body 200px van mijn #header af gaat?
Ik heb float: left; bij #content al geprobeerd, maar dat zorgde ervoor dat heel de webpagina aan de linkerkant lag en niet meer in het midden.
Laatst bewerkt door een moderator: