Sent by Lachlan Cannon on 4 February 2002 05:05
--- drt - lists [EMAIL-REMOVED]> wrote:
> Hello,
Hey
> I am not using CSS for positioning, but from what I read,
> it seems to make
> sense to use the following...
>
> ----
> <div class="header">
> header/top of page here
> </div>
>
> <div class="menu">
> menus here
> </div>
>
> <div class="content">
> page content here
> </div>
>
> <div class="footer">
> page footer/close here
> </div>
I would argue that this is definitely a case where you
should be using ids instead of classes. you're not using
two footers, or three headers, or countless menus - just
one of each, hence div to enforce that. classes are better
used for items which will be repeated throughout pages.
Also, using ids here would mean that people could link
straight to your content, or straight to the footer, if
something there interested them. Anyway, in the end it's
your choice.
> to help divide up my pages.
>
> Now the question is, in my style sheet, can I define
> separate classes under
> each section? For example have <H4> with certain values
> when placed within
> the header section and other values when say in the
> footer section?
sure you can, if you leave a space between selectors, it
means selector b that inherits at any level from selector
a. For example, if you'd switched over to ids, and you
wanted a rule for all h's in your footer you could select
it with
#footer h1, #footer h2, #footer h3 {css stuff}
or if you wanted to pick out links in the menu
#menu a {stuff}
> p.s. Over the weekend I got a few of my primary personal
> site to validate
> using the htmlhelp css validator and the iCab built-in
> validator :)
Congratulations! :) Isn't it nice when you finalyl solve
something - especially if it's bugged you for ages?
HTH
Lach
__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com