I've got some simple HTML code in which I am building the basic layout for a simple website.
I am trying to position the red bar to be vertically centered inside the green area. For some reason, it will not move down when I add a top margin. I've been trying to figure out why for a half hour - so frustrating!
Here's the JSFiddle: http://jsfiddle.net/Hut9M/
Here's the code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Basic</title>
</head>
<body>
<div id="milestone">
<div id="milestonecontent">
<div id="event">
</div>
</div>
<div class="actions">
</div>
</div>
</body>
</html>
And the CSS:
#body{
background-color: #e9eaed;
}
#milestone{
width: 512px;
height: 137px;
background-color: blue;
}
#milestonecontent{
width: 512px;
height: 104px;
background-color: green;
}
#event{
position: relative;
margin: 10px auto;
width: 512px;
height: 58px;
background-color: red;
}
.actions{
border-top: 1px solid #e9eaed;
position: relative;
width: 512px;
height: 33px;
background-color: grey;
}