I have two div's that I'm using in header section of my HTML5 main page. Eventually I want to refactor as an include, but that's for another post. I have the second div offset. I want to display the entire container area of the containing object - obviously, but I'm having trouble.
<body>
<div class="gridContainer clearfix>
<div id="div1" class="fluid">
<header id="headGraphics">
<div id="headRectangle1">"Rectangle1"</div>
<div id="headRectangle2">"Rectangle2"</div>
</header>
</div>
</div>
</body>
Here's my code using boilerplate.css.
.clearfix:before, .clearfix:after {
content:"";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
.gridContainer.clearfix #headGraphics #headRectangle1 {
background-color: #FF0100;
float: left;
width: 300px;
height: 75px;
position: relative;
}
.gridContainer.clearfix #headGraphics #headRectangle2 {
background-color: #FFC30C;
float: left;
/*margin-right: 50px;*/
width: 300px;
height: 75px;
position: relative;
top: 25px;
right: 200px;
}
.gridContainer.clearfix #headGraphics {
margin:auto;
margin-top: 20px;
}
#headGraphics {
overflow: hidden;
}
.gridContainer.clearfix #div1 {
}
.gridContainer.clearfix #mainNav .navTableGrid {
}
The overflow: hidden
initially worked properly, but I started working on a table to create a nav
and I noticed that all is lost.
I was wondering how to apply additional(multiple) classes to a selector. Can I simply add clearfix :before
and :after
to the class properties.
I'm using DW - not that that matters, but....
Again, overflow was working. What did I do?