Web Design and Development Forums

CSS query - Start here

This is a discussion on "CSS query - Start here" within the CSS Forum section. This forum, and the thread "CSS query - Start here are both part of the Design Your Website category.


Go Back   Webforumz.com > Design Your Website > CSS Forum

Welcome to Webforumz.com.
Register Now Register now!

Closed Thread
 
LinkBack Thread Tools Rate Thread
Old Mar 16th, 2008, 13:45   #1 (permalink)
Lead Administrator
 
saltedm8's Avatar
 
Join Date: Nov 2005
Location: Always About
Age: 27
Posts: 1,062
Blog Entries: 1
Send a message via MSN to saltedm8
CSS query - Start here

Despite the ability to search the forums, the same questions have a tendency to be asked again and again. This resource has been compiled to give you a base point for your CSS questions. It will be added to as and when required.

Two books I highly recommend are by the CSS Guru, Eric Meyer:
Eric Meyer on CSS - ISBN: 0-73571-246-X
More Eric Meyer on CSS - ISBN: 0-7357-1425-8
Published by New Riders

Software:
Whilst you can code your CSS in any text editor, I personally use and recommend TopStyle. It is available in both a free and a Pro version.
For Mac users, skEdit has been recommended though it has a cost od $25.

Two tutorials are available:
This one explains how to create a CSS driven menu system - both vertical and horizontal.
It will tell you everything you need to know with one or two bits left for you to work out but the answers are in the work already covered.
Then it becomes a question of personal styling.
http://1ontheweb.net/downloads/Creat...enu_system.pdf

This one gives you the basic templates, with full details of what's where and why, for laying out your web sites. Remove unwanted bits and add others as required. Fixed and fluid layouts are catered for.
http://1ontheweb.net/downloads/Templates.zip

Starting from zero:
Different browsers apply different levels of padding and margin on various elements by default. To be sure you know where you are starting from, always include this code at the start of your css file.
Code: Select all
* {padding: 0; margin: 0;}
Font sizing:
The best method, in my opinion, for sizing fonts is to use the 'em'. This gives the end user the greatest flexibility to adjust the font size to their needs. However you need to be aware of certain things.
To allow for a weird bug in IE, set a base point on the the <body> tag - font-size: 100.01% - nominally 1.
You can set individual sizes to be above and below this.
Remember that em is a relative size and relative to the next size above it in the container hiearchy.
Take the following example:
Code: Select all
<div id='outer' style='font-size: 0.8em'>
   <div id='inner' style='font-size: 0.8em>
      ...
   </div>
</div>
The font size in the outer div will be 0.8 of whatever the user has set as their base font size. The font size in the inner div will be 0.8 of 0.8.
So if the base font size is 12px, allowing for rounding up, the outer div will be 10px and the inner div will be 8px.
Note that in browsers like Firefox and Opera, the user can also set a minimum font size so how ever the sums work out, it will never display fonts smaller than this.

Style code location:
Always keep your CSS code in a seperate file(s) and use the <link... tag to link the file into yor html pages.
Keep code that makes tweaks to your CSS to accomodate browsers like IE6 and below in a seperate file and load it after your default file using the technique shown below:
Code: Select all
<!--[if lte IE 6]>
   <link rel="StyleSheet" type="text/css" href="ieonly.css" />
<![endif]-->
Sign your work:
What this means is giving your pages an identity that browsers can recognise.

Why you might ask? The answer is increased accessibility.

A lot of people do not realise that the <html> tag can have an id just like any other tag.

Lets assume that you have coded the following:

<html id='mysiteid'>

It's usual to use the site's actual domain name, but without the hyphens, dots, etc.

Now if an end-user is going to be a regular visitor to your site but need to adjust font, colour, etc., because of accessibility needs, they can create, or have created for them, a local style sheet which is coded up as follows:

#mysiteid h1{
...
}

#mysiteid p {
...
}

and so on.

Now every time they visit your site, the pages are automatically adjusted to meet that user's requirements.

The cost to you, the developer, to include this is trivial. You can explain its availability in the section on your site about accessibility.

Just as it's good practice to use em's rather than px's to specify font sizes. It gives the end user options.

Remember also that a users local css file takes priority over other style sheets unless you have used the !important override.

I don't think we give people with accessibility needs enough credit. If you have a need and there are ways you can improve the situation, you will learn how to make the tools work for you.

Other references:
http://www.w3schools.com/css/default.asp
__________________
recipebite.co.uk - its a working progress...
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start from the top zizther HTML Forum 7 Sep 10th, 2007 00:14
I don't even know where to start pa007 Flash & Multimedia Forum 1 Jul 25th, 2007 15:19
MySQL query query dangergeek MySQL 3 Apr 12th, 2007 12:45



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 17:11.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59