stack over
stack over

Reputation: 55

Folder Path not Working for Background Image

I have an local folder with my index.html file in it. It also contains a css folder containing mystyle.css and an images folder containing all of my images. I'm trying to create a background image but it won't display. Can anyone see why? My css is working correctly and below is what I have in my css:

/*CUSTOM*/

body {
    background-image:url('..\images\red_curtain.jpg');
}

Here is my HTML:

<head>
        <link rel="stylesheet" type="text/css" href="css\mystyle.css" />
        <meta http-equiv="content-type" content="text/php; charset=utf-8" />

Upvotes: 0

Views: 101

Answers (1)

Ken Herbert
Ken Herbert

Reputation: 5236

Try using forward slashes instead of back slashes in your CSS like so:

background-image:url('../images/red_curtain.jpg');

Upvotes: 1

Related Questions