
I want to produce a simple header with an orange background and a small div inside of it (centered) and have a "sign in" with social links floated to the right within the div.
But with the code below, seems like division header-top-bar doesn't expand accordingly with container in it. (I set the container to blue for testing). Also there is no margin setting so why does it still have a bit of white space around the header?
<div id="main-wrapper">
<header id="header">
<div class="header-top-bar">
<div class="container">
<div class="header-login">
<a href="#">Sign In / Register</a>
</div>
<!-- end .header-login -->
<!-- Header Social -->
<ul class="header-social">
<li><a href="#"><i class="fa fa-facebook-square"></i></a>
</li>
<li><a href="#"><i class="fa fa-twitter-square"></i></a>
</li>
<li><a href="#"><i class="fa fa-google-plus-square"></i></a>
</li>
<li><a href="#"><i class="fa fa-linkedin-square"></i></a>
</li>
<li><a href="#"><i class="fa fa-pinterest-square"></i></a>
</li>
</ul>
</div> <!-- end .container -->
</div>
#main-wrapper { overflow: hidden; }
#header { position: relative; }
#header a { text-decoration: none; }
.header-top-bar {
padding: 0px 0 0px 0;
background: #FF7F00;
color: #FF7F00;
}
.header-top-bar p {
position: relative;
float: right;
}
.header-top-bar{
padding-right: 0px;
padding-left: 0px;
margin-right: auto;
margin-left: auto;
border: 1px solid black;
}
.container
{
position: relative;
float: right;
margin-top: 0px;
border: 1px solid black;
background-color: blue;
}
.header-login a {
color: #fefefe;
font-size: 13px;
}
.header-login a:hover { color: #080000; }
.header-login a:last-child { margin: 0 0x 0 0px; }
.header-social {
position: relative;
margin: 0 auto;
padding-top: 0px;
float: left;
}
.header-social > li {
display: inline;
margin: 0 2px;
}
.header-social > li > a {
color: #ffffff;
font-size: 18px;
line-height: 30px;
}
.header-social > li > a:hover {
color: #080000;
}
Sorry for the messy code.
* { margin: 0; padding: 0; }to your css (at one of the first lines) to reset the margin and padding from user agent stylesheet(s)