Friday, March 13, 2015
Divs positioning
So the first solution was quite obvious:
<head>
<style type="text/css">
.Test
{
background-color: Black;
width: 1000px;
height: 250px;
margin-left: auto;
margin-right: auto;
}
.Test2
{
width: 1000px;
height: 25px;
background-color: Yellow;
margin-left: auto;
margin-right: auto;
margin-top: 200px;
}
</style>
</head>
<body>
<div class="Test">
<div class="Test2">
</div>
</div>
</body>
So a little trick was needed:
.Test
{
background-color: Black;
width: 1000px;
height: 250px;
margin-left: auto;
margin-right: auto;
/*try with or without this: display: table;*/
}
Any ideas why?
Labels:
divs,
positioning
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.