SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Location
    Florida
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Linking to external style sheet

    I am just getting started with CSS and have a simple question.

    After placing the relevant information between <head></head> and saving the external sheet as a .css document, how do I link from a specific area of my web pages to that sheet?

    I have several pages that I will link to the extrernal sheet. Only the bottom half of each pages will be linked to the external style sheet. The bottom half of each page has a list of the states in the USA and some of the links to these states are clickable and some are not. As more links become clickable I want to change the style sheet and change all the pages at the same time.

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello

    Just add this to the head section of the (X)HTML files you want to link to the style sheet

    Code:
    <link rel="stylesheet" type="text/css" media="screen" href="style.css" />
    Just change the path to suit your needs.

    Hope this helped

    later
    Johnny

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Location
    Florida
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have added the header portion and I have created the .css document already.

    How do I tell a certain part of the web page to link to the style sheet? I only want the bottom half of several web pages to link to the style sheet. The rest of the web pages will not be affected. Only a specific portion.

  4. #4
    SitePoint Zealot Arkkimaagi's Avatar
    Join Date
    Mar 2002
    Location
    Lappeenranta, Finland
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, you're speaking in confusing terms.

    It's not that you'd link stylesheet to spesific portion of the page. You target the effects of stylesheet to where you want on your page.

    So, like if you have loads of links on your site, and you want the css commands to affect only the ones in the footer, you could do this:

    Try to figure out a way to personalize the footer area. If you have not used links inside a div on anywhere else on your site, you could target them like this:
    Code:
    div a{color:red;/*and some other style commands for your links*/}
    Or if you can add a class ( class="myFooterClass" ) to the element that holds the footer links, you could target CSS like this:
    Code:
    .myFooterClass a{color:red;/*and some other style commands for your links*/}
    If you post a sample HTML page source here, and tell what you want to target, maybe someone could tell you how it could be done.

  5. #5
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hello

    Oops, sorry I misunderstood.

    If you post a sample HTML page source here, and tell what you want to target, maybe someone could tell you how it could be done.
    Definetly you will get some help if you post the code.

    Later
    Johnny


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
  •