| View previous topic :: View next topic |
| Author |
Message |
thomasp
Joined: 21 Feb 2005 Posts: 11 Location: UK
|
Posted: Sun Sep 04, 2005 1:38 am CSS Beginner - help needed! |
|
|
|
Hi,
I know absolutely nothing about CSS, but would like to begin implementing it in my website, since <font ...> is getting a bit too messy!
I've tried reading the instructions in the CSS section of the site (and also the "Break the <Font > habit" section), but I'm not really sure where to start, as I'm having difficulty understanding everything! I think I'm OK with most of the stuff in the 'Break the <font> habit" section.
I'd like to have an external style sheet, but I don't know where to start.
If possible could someone post a simple-to-underestand, step-by-step guide for starting CSS, and how to set a font for a webpage (let's say, Arial, black, size=2)?
Thanks  |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8267 Location: Castle Rock CO USA
|
Posted: Sun Sep 04, 2005 7:13 am |
|
|
|
Something like:
| Code: |
body
{
background-color: #fff;
margin: 0;
font-size: 10pt;
font-family: Arial, Verdana, Helvetica, sans-serif;
color:#000;
} |
Change the font size as you wish. You can also find some CSS references here. |
|
thomasp
Joined: 21 Feb 2005 Posts: 11 Location: UK
|
Posted: Sun Sep 04, 2005 7:41 am |
|
|
|
| Corey Bryant wrote: |
Something like:
| Code: |
body
{
background-color: #fff;
margin: 0;
font-size: 10pt;
font-family: Arial, Verdana, Helvetica, sans-serif;
color:#000;
} |
Change the font size as you wish. You can also find some CSS references here. |
Hi,
Thanks for the reply.
The bit that's really confusing me is how to actually link to the external style sheet (most of the webpages use the same styles, so I might as well have one style sheet, rather than embedding the same code in about 30 webpages) from the webpage.
I saw in the CSS section that you have to put the doctype thingy in and it mentions that you have to be very strict on your coding. How strict is "very strict" and what could cause the most problems?
Thanks for the help  |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8267 Location: Castle Rock CO USA
|
Posted: Sun Sep 04, 2005 7:52 am |
|
|
|
Your HTML does not have to be correct but of course that helps.
To add it, place this in the head:
| Code: |
| <link rel="stylesheet" href="includes/style.css" type="text/css"> |
|
|
thomasp
Joined: 21 Feb 2005 Posts: 11 Location: UK
|
Posted: Sun Sep 04, 2005 8:36 am |
|
|
|
Thanks
When I create the external CSS file, do I have to put any type of heading, or just start typing the code?
The first bit of my website has code much like this:
| Code: |
<body bgcolor="white">
<font face="Arial" size=3 color="black"> |
When I've put this into CSS, how do I start off the HTML code for that style? Do I use the <DIV CLASS...> </DIV> codes?
Thanks for the help  |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8267 Location: Castle Rock CO USA
|
Posted: Sun Sep 04, 2005 9:31 am |
|
|
|
| You only start typing. You put body in the top of the CSS whch signifies the body. And of course you would not use your code at all |
|
thomasp
Joined: 21 Feb 2005 Posts: 11 Location: UK
|
Posted: Sun Sep 04, 2005 9:38 am |
|
|
|
So to get a very large block of text (most of the page) formatted in the way I specified above would I just use <DIV CLASS [classname]> [text] </DIV> (after writing the CSS, of course )? |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8267 Location: Castle Rock CO USA
|
Posted: Sun Sep 04, 2005 10:19 am |
|
|
|
| That would be it |
|
thomasp
Joined: 21 Feb 2005 Posts: 11 Location: UK
|
Posted: Mon Sep 05, 2005 3:07 am |
|
|
|
| Corey Bryant wrote: |
Something like:
| Code: |
body
{
background-color: #fff;
margin: 0;
font-size: 10pt;
font-family: Arial, Verdana, Helvetica, sans-serif;
color:#000;
} |
|
I have three different "types" of pages - one with a white background and 16pt black text, one with a white background and 13pt black text, and another with a black background and white text 13pt and 10pt in size (both on the same page).
Is it possible to have three different "body" CSS styles, like the one above, or is it best to use <body bgcolor=.....> and then <DIV CLASS=....> to set the text formatting?
Thanks for the help and sorry if these are stupid questions  |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8267 Location: Castle Rock CO USA
|
Posted: Mon Sep 05, 2005 6:35 am |
|
|
|
CSS 2 does not allow for multiple backgounds, but CSS3 does when it is released although IE will not support it.
You want to get away from bgcolor so use CSS and divs
| Code: |
body
{
background-color: #fff;
margin: 0;
font-size: 10pt;
font-family: Arial, Verdana, Helvetica, sans-serif;
color:#000;
}
div.header
{
font-size: 11pt;
}
div.content
{
font-size: 12pt;
}
div.footer
{
font-size: 10pt;
color:#ff0000;
} |
You can use something like this - changing only what you need to change for each layer |
|
abhi007
Joined: 12 Sep 2005 Posts: 2
|
Posted: Mon Sep 12, 2005 5:25 am use webmaster resources |
|
|
|
hey try for ebooks on CSS
dreamweaver is very easy tools for CSS
You can use tutorials sites t00 for that.
this will help you to learn more..
*** Abhi ***
www.itdepth.com - Free Webmaster Resources |
|
|