I'm sorry, i just a newbie designer. I want to ask something, how to make the background color to move to the top? It still split by white space(the top of the background color)
<!DOCTYPE html>
<html>
<head>
<style>
body{
margin: 0px;
padding: 0px;
}
#navbar{
position: relative;
background: #004f6b;
height: 100px;
color: white;
}
li{
list-style-type:none;
display:inline;
}
#navbar > ul > li#title{
position: absolute;
left: 5px;
}
#navbar > ul > li#homeicon{
position: absolute;
left: 610px;
}
#navbar > ul > li#search{
position: absolute;
right: 300px;
}
#navbar > ul > li#profile{
position: absolute;
right: 5px;
}
</style>
</head>
<body>
<div id="navbar">
<ul>
<li id="title">Title</li>
<li id="homeicon">Icon</li>
<li id="search"><input type="text" style="width:210%"/></li>
<li id="profile">Follow Us!</li>
</ul>
</div>
</body>
</html>
Screenshot : http://i58.tinypic.com/rhr8xt.png Sorry for my bad english and sorry for my bad skill... Thanks for your help...
The
ul
element has a defaultmargin
that is pushing all of the content down. You can simply specifymargin: 0;
on theul
to solve this.