user1548544
user1548544

Reputation: 2985

CSS background-image not showing

I'm new to CSS and when I try to insert a background-image it won't show up.

HTML:

<div id="logo"></div>

CSS:

#logo {
   background-image: url(../images/logo.png);
   background-repeat: no-repeat;
   width: 376px;
   height: 81px;
   margin-top: 28px;
   margin-left: 128px;
}

Upvotes: 0

Views: 3565

Answers (1)

BonyT
BonyT

Reputation: 10940

You need quotes around the path in the URL, and semi-colons after the height & width

#logo {
    background-image: url("../images/logo.png");
    background-repeat: no-repeat;
    width: 376px;
    height: 81px;
    margin-top: 28px;
    margin-left: 128px;
}

Upvotes: 6

Related Questions