PDA

View Full Version : Implementing CSS to a site



rickyd
14th December 2007, 04:36 PM
Hey there.

As some of you know I just started using Coda around 15 minutes ago and I am trying to create a CSS style sheet to accompany my home page.

Why is this not working;


<html>

<head>
<style type="text/css">

Home {
background-color: gray;
font-size: 3px;
font-family: "Helvetica Neue";
}

</style>

</head>
</html>

<body>

<font face = "Helvetica Neue" size="3">welcome to mysite.com</font>

</body>

TIA,
Ricky.

decryption
14th December 2007, 04:38 PM
Have you even read any documentation?
Grab a book from the library on CSS, a copy of CSSEdit and go from there.

El Guardo
14th December 2007, 04:39 PM
Probably because it's not a style sheet.

Actually, if you want to learn web design and aren't willing to to go to University, enroll in developers course or take some sort of structured training program, the best place to start is as Decryption suggested - grab yourself the basic introductory text books, work your way through them and learn from building your own works, looking at the source code of others (but not borrowing it), and contributing to developer forums.

And in terms of starting, forget about style sheets. Begin with HTML basics, like in the beginners guide by Elizabeth Castro, and go from there.

rickyd
14th December 2007, 04:40 PM
Decryption, I have. In class. Okay, I forgot most of it. But from the way Coda works you just click on the CSS tab and enter your "parameters" or whatever you want to call them. Coda even puts in all that junk about CSS by itself at the top.

Ricky.

fiark
14th December 2007, 04:43 PM
For a start you are mixing style with content. Big no-no.

Your </html> needs to be at the end of your document...


Those spaces between "font face and =" and after the = get rid of them

font-face?

Try that, I don't know much but those two things look suspect.

Go to Westciv, they have great training manuals that will teach you the basics about where your tags need to go etc. Not necessarily free but I think you need to learn the basics...

http://www.westciv.com/style_master/academy/css_tutorial/index.html

adamd
14th December 2007, 04:46 PM
Hey there.

As some of you know I just started using Coda around 15 minutes ago and I am trying to create a CSS style sheet to accompany my home page.

Why is this not working;


<html>

<head>
<style type="text/css">

Home {
background-color: gray;
font-size: 3px;
font-family: "Helvetica Neue";
}

</style>

</head>
</html>

<body>

<font face = "Helvetica Neue" size="3">welcome to mysite.com</font>

</body>

TIA,
Ricky.

That is WRONG...

Should be like this:

<html>
<head>
<style type="text/css">
.home {
background-color: gray;
font-size: 3px;
font-family: "Helvetica Neue";
}
</style>
</head>

<body>
<font class="home">welcome to mysite.com</font>
</body>
</html>

It's not perfect, but it works. You need to learn SPAN's, DIV's and other CSS elements

El Guardo
14th December 2007, 04:49 PM
From memory font face has only been implemented in two browsers, Safari and Opera, and even then only in the nightly builds. And I wouldn't be touching it if I couldn't manage DIVs, SPANs and CLASSes...

rickyd
14th December 2007, 04:51 PM
Thank you.

Aa
14th December 2007, 05:04 PM
Keep your CSS within the head tag and use classes for recurring items and id's for specific items.

Don't forget your doctype, and validate your site with W3C to see what you've botched. Which will be plenty.;)

kingsdesign
14th December 2007, 06:50 PM
Everything you want to do can be done in the body tag


<html>

<head>
<style type="text/css">

body{
background-color: gray;
font-size: 3px;
font-family: "Helvetica Neue";
}
</style>
</head>

<body>
welcome to mysite.com
</body>
</html>
hope this helps

All the info you need can be found at w3schools (http://w3schools.com/)

Rik