How to remove page margin
the space is display between page margin and nevigation bar, So how to delete this space
css code
#topnav ul
{
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;
}
#topnav li
{
float:left;
display:inline;
}
#topnav a:link,
#topnav a:visited
{
display:inline-block;
width:110px;
font-weight:bold;
font-family:calibri;
color:#FFFFFF;
background-color:#98bf21;
text-align:center;
padding:3px;
text-decoration:none;
text-transform:uppercase;
}
#topnav a:hover,
#topnav a:active
{
background-color:#7A991A;
}
html code
<ul id="topnav">
<li id="topnav"><a href="#home">Home</a></li>
<li id="topnav"><a href="#news">OPD</a></li>
<li id="topnav"><a href="#news">IPD</a></li>
<li id="topnav"><a href="#news">Infrastucture</a></li>
<li id="topnav"><a href="#news">Gallery</a></li>
<li id="topnav"><a href="#news">Media</a></li>
<li id="topnav"><a href="#contact">Site Map</a></li>
<li id="topnav"><a href="#about">About</a></li>开发者_Go百科
<li id="topnav"><a href="#about">Nursing</a></li>
</ul>
You need to specifically set margin and padding to 0 on the "body" element.
just try this in your css:
body { margin: 0; padding: 0; }
Try to add
#topnav { font-size: 0; }
#topnav li { font-size: 12px; } /* or your font size that needed there */
精彩评论