Wow Hugh. It's great that you took the time to help me and grant me encouragement. I greatly appreciate it.
This makes all the sense in the world. The one thing is I was confused about was dl, dt, & dd. I found some info online to learn up on it.
I really can't thank you enough.


Shane Helm


On Jun 22, 2004, at 5:44 PM, Hugh Todd wrote:

Shane, you said,

Sorry. I am so new. I'm not sure what you mean by inheritance for my elements. Are spans bad?

Your aim should be to create HTML that is clean and independent of your particular style sheet. I say *aim*, because it's a difficult goal to reach entirely.


This is where "inheritance" becomes your friend. By dividing your pages into boxes with your divs, you are making it easier to target specific elements without the need to rely on classes and spans.

So, for example, you may have five main boxes on your page. Each of them is unique, so can be given an id (#). You know this already.

Now you can choose to make any or all of the elements *within* each id behave either the same or differently from your master elements (if you have them) - by which I mean any top-level styles you may have applied to the body, h's, etc.

Thus you may set up your basic font parameters in the body like this:

body
{ background: #fff;
font-family: verdana, arial, sans-serif;
font-size: 76%;
color: #666;
line-height: 1.2em;
}

the p in your #main box like this:

#main p
{ font-size: 1.2em;
margin: 1em 1.5em 0 1.5em;
}

and the p in your right hand div like this:

#contactinfo p

{ font-size: 1em;
margin: 0;
}

(Note, these examples are illustrative only.)

In this way you sidestep the need to apply specific classes to elements, which lock you in to ongoing maintenance and a reliance on your particular stylesheet.

Looking at your code I saw that, in the right hand column, you had applied a class to the contact name. To avoid this, (and because it makes semantic sense) I suggested that you use a dl instead. The contact name becomes the dt, and the address details become the dd. In this way you are able to apply styles as I suggested, without the use of special classes.

The only place where I could not work out a way to avoid applying a span was with the qualification after your contact's name. But to do that, better to put it into your main (external) stylesheet and give it a semantic name, like ".qualification". This tells you what the style *means* rather than what it does.

All the best! You're going well!

-Hugh Todd

PS A cheap PC with Win 2000 or WinXP on it sounds like a great idea. Someone has put together a package that installs IE5, 5.5 & 6 on the same machine -- an invaluable service. (Only works on the OSs I mention.)

*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
*****************************************************

*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
*****************************************************




Reply via email to