HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
CSS Beginner - help needed!
Post new topic   Reply to topic    HTML Help Forum Index -> CSS
View previous topic :: View next topic  
Author Message
thomasp



Joined: 21 Feb 2005
Posts: 11
Location: UK

PostPosted: Sun Sep 04, 2005 1:38 am     CSS Beginner - help needed! Reply with quote

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 Smile
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8267
Location: Castle Rock CO USA

PostPosted: Sun Sep 04, 2005 7:13 am     Reply with quote



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

PostPosted: Sun Sep 04, 2005 7:41 am     Reply with quote

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 Smile
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8267
Location: Castle Rock CO USA

PostPosted: Sun Sep 04, 2005 7:52 am     Reply with quote

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

PostPosted: Sun Sep 04, 2005 8:36 am     Reply with quote

Thanks Smile

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 Smile
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8267
Location: Castle Rock CO USA

PostPosted: Sun Sep 04, 2005 9:31 am     Reply with quote

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

PostPosted: Sun Sep 04, 2005 9:38 am     Reply with quote

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 Wink )?
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8267
Location: Castle Rock CO USA

PostPosted: Sun Sep 04, 2005 10:19 am     Reply with quote

That would be it
thomasp



Joined: 21 Feb 2005
Posts: 11
Location: UK

PostPosted: Mon Sep 05, 2005 3:07 am     Reply with quote

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 Smile
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8267
Location: Castle Rock CO USA

PostPosted: Mon Sep 05, 2005 6:35 am     Reply with quote

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

PostPosted: Mon Sep 12, 2005 5:25 am     use webmaster resources Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> CSS All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial