problem linking in css

vheiar03

New Member
I am having a problem with my css and linking my images. My css is linking correct but I am having problem linking to the image. I am thinking it might be my folder structure.

Folder Structure:

index.html
(folder)images/ banner.png
(folder)styles/ style1.css




.banner {
background-image: url("banner.png");
height: 200px;
width: 1920px;
position: relative;
}




<html>
<head>
<link rel="stylesheet" type="text/css" href="styles/style1.css">
<title>X</title>
<body>
<div class="banner"/>
</body>
</html>
 
Last edited:

Phreaddee

Super Moderator
Staff member
HTML:
background-image: url("indexbanner.png");
change to
HTML:
background-image: url(../images/banner.png);
 
Last edited:

indradoang

New Member
CSS:
Code:
[SIZE="1"].banner {
background-image: url[/SIZE][SIZE="4"]('..images/banner.png')[/SIZE][SIZE="1"];
height: 200px;
width: 1920px;
position: relative;
}[/SIZE]
HTML:
Code:
[SIZE="1"]<html>
<head>
<link rel="stylesheet" type="text/css" href="styles/style1.css">
<title>X</title>[/SIZE][SIZE="4"]</head>[/SIZE][SIZE="1"]
<body>
<div class="banner"[/SIZE][SIZE="4"]></div>[/SIZE][SIZE="1"]
</body>
</html>[/SIZE]
 
Last edited:
Top