rae
rae

Reputation: 23

How to remove the extra space above my navigation bar

I'm a beginner to HTML and CSS. Was doing this for fun. How do I remove the extra space above the navigation bar? Also, apologise if HTML codes are a bit wack, truly a beginner here. Tried putting all different kinds of margin to 0 and padding to 0 but still wouldn't work. Lol please help.

pic of problem here

Code is below:

<body>
<div class="bg-img">
    <!-- Start of Header -->
    <header>
        <!-- Start of Navigation Bar -->
            <nav>
                    <ul>
                        <li><a href="index.html">HOME</a></li>
                        <li><a href="newreleases.html">NEW RELEASES</a></li>
                        <li><a href="musicsuggestions.html">MUSIC SUGGESTIONS</a></li>
                        <li><a href="musicreviews.html">MUSIC REVIEWS</a></li>
                        <li><a href="feedback.html">FEEDBACK</a></li>
                    </ul>
            </nav>
        <!-- End of Navigation Bar -->
</div>
        <h1>NEW RELEASES</h1>
        
    </header>

html, body {
   padding:0px;
   margin:0px;
   height: 100%
}

body{
    background-color: #294036;
    margin: 0;
}

.bg-img{
    background-image: url("images/header1.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 500px;
    padding-bottom: 0px !important;
}
    
ul{
    width: auto;
    padding: 15px 30px;
    text-align: center;
}

li{
    display: inline-block;
    padding: 15px 30px;
}

a{
    text-align: center;
    text-decoration: none;
    font-family: arial, sans-serif;
    color: white;
}

a:hover{
    text-decoration: underline;
}


h1{
    margin: 25px;
    font-family: arial, sans-serif;
}


Upvotes: 0

Views: 57

Answers (1)

Alexander S.
Alexander S.

Reputation: 60

In order to fix your problem, you just have to add

margin-top: 0px;

to ul in your css

Upvotes: 1

Related Questions