Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove page margin

Tags:

css

navigation

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>
    <li id="topnav"><a  href="#about">Nursing</a></li>
</ul>
like image 361
Rameez Avatar asked Dec 16 '22 12:12

Rameez


1 Answers

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; }
like image 101
Mohag519 Avatar answered Dec 19 '22 07:12

Mohag519