Thomas Pen
Thomas Pen

Reputation: 77

HTML banner in header doesn't show

I'm trying to display a image as the background in my header, but nothing seems to happen.

This my css code where I set the specs of my image(500 * 2000):

header{
background-image: url(../images/banner2.png);
background-repeat: no-repeat;
margin: 0 auto;
max-height:100px;
width: 100%;
}

And this is my HTML code:

 <!DOCTYPE html>
    <html>
    <head>
    <title>Contact</title>
    <link rel="stylesheet" href="../css/main.css" />
    </head>
    <body id = "contact">
    <header></header>
    <div id="page">
    <div id="logo">
        <h1><a href="../html/index.html" id="logoLink">Baby kleding online</a></h1>
    </div>
    <div id="nav">
        <ul>
            <li><a href="../html/index.html"id="homenav">Home</a></li>
            <li><a href="../html/kleding.html"id="kledingnav">Kleding</a></li>
            <li><a class="inuse" href="../html/contact.html"id="contactnav">Contact</a>      </li>
            <li><a href="../html/vragen.html"id="vragennav">Vragen</a></li>
        </ul>
    </div>
    <div class="content">
        <h2>Contact</h2>
    </div>
    <div class="Images">
        <b target="_blank" href="kleding.htm">
            <img src="../images/logo.PNG" alt="Boy1" width="300" height="140">
        </b>
    </div>
</div>
</body>
</html>

Upvotes: 0

Views: 2002

Answers (1)

user1817311
user1817311

Reputation:

In order to fix your problem you have to assign a height to your header. This can be done by using the height: [Amount of pixels]px;

Or you can add something in between the <header></header> tags that will make the header show.

Upvotes: 1

Related Questions