SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    TOTALLY Confused, CSS, HREF

    Hi

    http://www.box-breaker.co.uk/index.htm
    http://www.box-breaker.co.uk/files/styles/screen.css

    You see the links down the right hand side in the white box, for some reason the style of those links seems to be applying to the text in the main content box.

    How do I tell the site to display links down the left using a certain style, links in main content area use another style, footer links use a third style, and on and on.

    I know its something to do with class and id's but I'm not sure.

    Any help?

    Thanks =)

  2. #2
    SitePoint Zealot c.t.c.'s Avatar
    Join Date
    Apr 2007
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just loaded the page in FF3 on Linux and each section did already have its own unique link styles.

    To do this in general though, give the containing element of each section an id in your HTML. Then in CSS, use decendant selectors to target the elements withing the id. For example, if your header has an id of "header" and your footer has an id of "footer", you can style links differently in each section using "#header a" and "#footer a".

    Also, I noticed you're using an XHTML doctype. In that case, all your CSS rules should be written in lowercase.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •