Topic: CSS Beginner - I can't link to an external stylesheet? [fixed]
Hi,
[FIXED - it seems that my .html file was loading correctly, but there was a problem with Komodo Edit's preview, which made me think something was wrong. Thanks.]
I've gone through the css tutorial at w3schools.com - but I can't seem to make my html file link to my css file.
In my root folder I have the index.html file, and a "styles" folder which contains my "aagstyle.css" file.
Index.html code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
[title, meta tags, etc.]
<link rel="stylesheet" type="text/css" href="styles/aagstyle.css" />
</head>
<body>
<h1>Hello World</h1>
. . . .
</body>
</html>In my css file: (just some things I pulled out of the tutorial to experiment with)
body
{
background-color:red;
font-family:arial,georgia,sans-serif;
font-size:100%
}
h1 {color:blue}
hr {color:red}
p
{
font-size:0.75em;
margin-left:20px;
color:red
}
p.intro
{
height:100px;
margin:50px 20px
}
p.left {text-align:left}
p.center {text-align:center}
p.right {text-align:right}What am I doing wrong? My .html file has no styling at all. I'm assuming it's something to do with the directories, but I can't figure it out.
If it makes any difference I'm using Komodo Edit on Mac OSX 10.5.8
Thanks.
Last edited by NikMac (2009-09-25 19:53:19)
