Note : Solution has been appended to the answer at the bottom.
Okay, I've been doing it all the time but now it doesn't work.
Here is my folder structure which is so simple :
+ root |_ + styles |_ -main.css |_ + images |_ - background.jpg |_ - index.html
Here is the html code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<link href="styles/main.css" type="text/css"/>
</head>
<body>
<div class="main">
</div>
</body>
</html>
Css Code :
body
{
}
div .main
{
background-image:url(../images/main_background.jpg);
background-repeat:no-repeat;
height:950px;
width:897px;
}
The problem is : css file doesn't seem to be loaded and there is no css styles applied to class name main on the html file. That's really frustrating. I've also put them under IIS creating an Application under.
What could be wrong?
Thanks.
Solution:
Since the both answer should be at the same place to solve my problem, I decided to put complete answer here:
- It should have been
div.main - and
<link href="styles/main.css" type="text/css" rel="stylesheet"/>