I am unable to move a div (.searchblock). I would like it to be centered in the header.
Side question: Is there an easy way to get the contents of the header and the body aligned to the same width?
On the div in question, I have tried position: fixed, absolute, relative. I have tried centering the div with margin: auto, and various other values. I have tried moving the div in all directions (position: absolute, top: 50px, right 100-1000px, etc.) as well. Nothing seems to have an effect on it's positioning.
html {
background-color: #e9ebee;
}
body {
margin: 0;
}
.header {
background-color: #4267B2;
#4267b width: 100%;
height: 42px;
}
#search {
color: gray;
height: 24;
}
input[type=image] {
height: 24;
padding: 0px;
}
.searchblock {
position: absolute;
left: 1000px;
}
#profile {
border-radius: 10px;
}
ul,
.bttn {
color: white;
list-style-type: none;
display: inline-block;
}
li {
float: right;
font-family: Arial, Helvetica, sans-serif;
font-size: 12pt;
padding: 0 10px 1px;
border-right: solid 1px gray;
}
button {
border: none;
padding: 0;
margin: 0;
}
.footer {
position: fixed;
width: 100%;
height: 50px;
bottom: 0;
background-color: #2851A3;
margin: 0;
}
<div class="header">
<div class="searchblock"></div>
<img id="logo" src="facebook.png" height="24" width="24">
<input id="search" type="text" name="search" value="search">
<input type="image" name="submit" src="maglass.png">
<img id="profile" src="blacwhit.jpg" height="24" width="24">
<ul>
<li>Create</li>
<li>Find Friends</li>
<li>Home</li>
<li>Anthony</li>
</ul>
<div class="bttn">
<button type="button"><img src="messages.png"height="24" width="24">
</button>
<button type="button"><img src="frequest.png"height="24" width="24">
</button>
<button type="button"><img src="alerts.png"height="24" width="24">
</button>
<button type="button"><img src="acct.png"height="24" width="24"></button>
<button type="button"><img src="help.png"height="24" width="24"></button>
<button type="button"><img src="dropdown.png"height="24" width="24">
</button>
</div>
</div>
I would like the DIV to be centered in the header.