I’m new to web development, but I have been looking ofr a solution to this problem for days now, so I decided to finally ask you.
I have an empty page with a background defined in an external sylesheet.
Apart from that, I have included in the body a div which I will use to position images via the external stylesheet, rather than just inserting an tag in the html file.
Here is my html file:
<! DOCTYPE html public "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<title>Azin Productions</title>
<link rel="stylesheet" type="text/css" href="style/style_2.css">
<link rel="stylesheet" type="text/css" href="style/MyFontsWebfontsOrderM3219563.css">
</head>
<body>
<p>Hello World</p>
<div class="bit_1"></div>
</body>
and here is my stylesheet:
body {
background: url(images/NYCNEW.jpg);
background-size:100% 130%;
background-repeat:no-repeat;
z-index: -100;
font-family: Museo-500; calibri;
}
p {
color:orange;
}
.bit_1 {
color:blue;
background-image: url(images/bits/bit_1.png)
z-index: 500
}
-and yes, I am absolutely sure the links are correct 🙂
Thanks in advance,
Magnus
If your css file is in a folder then you need to add ../ before the image path.
../ represents the root folder.
change the code like this
You need to add ../ before the image path. ../ represents the root folder.