Results 1 to 6 of 6

Thread: Assigning A Stylesheet....

  1. #1

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Assigning A Stylesheet....

    Hi all!
    Code:
    <LINK href="MyStyleSheet.css" type="text/css" rel="stylesheet">
    Rather than specifying a stylesheet for the whole of my webpage, I don't suppose there's any way I could assign say, only a single table or element to the stylesheet?

    Many thanks for any suggestions!

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  2. #2
    Fanatic Member riis's Avatar
    Join Date
    Nov 2001
    Posts
    551
    If you need css for only a single element, you're better off using the style attribute:
    For example:
    <td style="background-color:red">Stuff</td>

  3. #3
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    how about creating a class and applying it to the tags you require? Just a idea...

    Code:
    .aClass {color:red;}
    
    .......
    
    <a class="aClass" href="http://www.test.com">Test</a>
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  4. #4

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Thanks for the suggestions!

    I cheated & just took out a style element from the stylesheet that was conflicting with my right frame.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Or if it's for one element only you could use an ID:

    Code:
    CSS:
    #myId {
      /*Blah blah...*/
    }
    
    HTML:
    <p id="myId"><!--blah blah--></p>

  6. #6
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Look into the @import thing for CSS - I'm not sure off hand if it'll do what you want, and it defininately won't work with older browsers (NS4, etc).
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

Posting Permissions

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



Click Here to Expand Forum to Full Width