Is there something wrong here?

I started using divs and I write the initial coding. Saved the css and the html page but when I preview it, it doesnt seem to work. ?

Heres the css coding:


body (
background-color: #999999
font-family:verdana, sans-serif; color: #000000; font-size: small; line-height: 1.6em
}
#main {
width: 538px;
height: 400px;
margin: 35px auto;
text-align: left;
}

and here is the html page:


<head>
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="C:\Documents and Settings\Owner\Desktop\css3.css">
</head>
<body>
<div id="main">
<p>hello</p>
</div>
</body>
</html>

the result is just a white/blank colored bg and left-aligned text of “hello” thats in Times New Roman when I specified it to be verdana above where set it to Verdana.

Whats wrong?

edit: its C:\Documents and Settings\Owner\Desktop\css3.css (couldnt get it fixed above.

First of, when trying out css it’s best to put the whole thing into the HTML for easy editing. Second, never forget the ; at the end!. Thirdly , a ( is different from a {.


<html>
<head>

<title>Untitled Document</title>

<style type="text/css">
body {
background-color: #999999;
font-family:verdana, sans-serif;
color: #FF0;
font-size: small;
line-height: 1.6em;
}

#main {
width: 538px;
height: 400px;
margin: 35px auto;
text-align: left;
}
</style>
</head>

<body>
<div id="main">
<p>hello</p>
</div>
</body>
</html>

Nay! I say use the <link> tagimagine you have 20 web pages, and the css is:

body {
 bgcolor="#FFF";
 }

And then you decide to make your site have a blue background. Imagine the annoyance!
running them all through one file is much more accesable.

MINIMALISTIK.
Two problems:
[list=1]
[]as [m] said, don’t forget your semi-colons
[
]and its much easier to work your website in a root folder, notice the link in your HMTL, missing a slash, just stick them in a folder called Root or Website or w/e.
[/list] [indent]> Website (folder)
[indent]> css3.css

index.html
[/indent] [/indent] Then your link tag can just be as follows:

<link rel="stylesheet" type="text/css" href="css3.css" />

Remember, organisation and a good proof reader are the key to succesful coding!

as [m] said, don’t forget your semi-colons
and its much easier to work your website in a root folder, notice the link in your HMTL, missing a slash, just stick them in a folder called Root or Website or w/e.
> Website (folder)
> css3.css
> index.html

Didnt see the ( instead of the { so thanks. I would have placed it in a root folder but im schelduled for a reformat so I moved the root folder. I didnt have a slash as I said above, when I posted this thread, it didnt appear.

I can’t argue with that logic! But I said “when trying out css”. :slight_smile:

Gawd*mn, it’s that bloody selective vision again…:ro:

/me hits head

Ah that’s better… :slight_smile:

[EDIT] nice filter system, but is d.a.m.n really that bad?

try danm! :wink: