HTML5/CSS layout

I have an html page layout with 3 <div> sections which I wish to display with DIV1 and DIV2 next to each other and DIV 3  immediately underneath DIV1 without any intervening vertical space. I have coded it as per the code shown below  but there is a gap underneath DIV1 before DIV3 is displayed. I can make things fit by reversing the order of displaying DIV1 and DIV2 but this is not what I want, DIV 1 must be on the  left of DIV2. What am I doing wrong ?

<!DOCTYPE html >
<html>
<head>

<title>Test 1</title>

<style>
/*RESET START*/
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;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
/*RESET END*/

#wrapper { width:1200px}

#div1 {float:left; height:50px; width:600px;border-left:0px; background-color: #66FF33; font-size:24px; font-weight:bold;}

#div2 {float:left; height:100px; width:600px;border-left:0px; background-color:#FF00FF;font-size:24px; font-weight:bold;}

#div3 {float:left; height:50px; width:300px;border-left:0px; background-color:#FF6600;font-size:24px; font-weight:bold;}

	
}
</style>

</head>

<body> 

<div id="wrapper">
	<div id="div1">
	 <p>DIV 1</p>
	</div>
	
	<div id="div2">
	<p>DIV 2</p>
	</div>
	
	<div id="div3">
	<p>DIV 3</p>
	</div>

</div>
</body>

</html>

Open in new window

LVL 2
Roger AlcindorAsked:
Who is Participating?
 
Eddie ShipmanAll-around developerCommented:
Add these to the #div3 selector:
    position: absolute;
    top: 50px;

Open in new window

0
 
Roger AlcindorAuthor Commented:
Thanks Eddie.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.