CSS

Discussion in 'HTML' started by Blindsya, Jul 10, 2003.

  1. Blindsya

    Blindsya Guest

    Hey everybody, I'm using CSS on my site and was just wondering if it
    possible to use two different styles on two different <td> tags on the same
    page? If so how?
    Any help would be much appriciated.
    Blindsya, Jul 10, 2003
    #1
    1. Advertising

  2. Blindsya

    Mark Parnell Guest

    Blindsya wrote:
    > Hey everybody, I'm using CSS on my site and was just wondering if it
    > possible to use two different styles on two different <td> tags on
    > the same page? If so how?
    > Any help would be much appriciated.


    ..td1 {border: 1px solid black;}
    ..td2 {border: 5px dotted green;}

    <table>
    <tr>
    <td class="td1">foo</td>
    <td class="td2">foo</td>
    </tr>
    </table>

    --

    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Jul 10, 2003
    #2
    1. Advertising

  3. Blindsya

    Blindsya Guest

    Blindsya wrote:
    Hey everybody, I'm using CSS on my site and was just wondering if it
    possible to use two different styles on two different <td> tags on the same
    page? If so how?
    Any help would be much appriciated.

    ..td1 {border: 1px solid black;}
    ..td2 {border: 5px dotted green;}

    <table>
    <tr>
    <td class="td1">foo</td>
    <td class="td2">foo</td>
    </tr>
    </table>


    Hey, thanks. Works perfectly!
    Blindsya, Jul 10, 2003
    #3
  4. Mark Parnell wrote:

    > Blindsya wrote:
    >
    >>Hey everybody, I'm using CSS on my site and was just wondering if it
    >>possible to use two different styles on two different <td> tags on
    >>the same page? If so how?
    >>Any help would be much appriciated.

    >
    >
    > .td1 {border: 1px solid black;}
    > .td2 {border: 5px dotted green;}
    >
    > <table>
    > <tr>
    > <td class="td1">foo</td>
    > <td class="td2">foo</td>
    > </tr>
    > </table>
    >

    Better to use IDs:

    #td1 {border: 1px solid black;}
    #td2 {border: 5px dotted green;}

    <table>
    <tr>
    <td id="td1">foo</td>
    <td id="td2">foo</td>
    </tr>
    </table>
    Leif K-Brooks, Jul 10, 2003
    #4
  5. Blindsya

    Mark Parnell Guest

    Leif K-Brooks wrote:
    > Mark Parnell wrote:
    >
    >> Blindsya wrote:
    >>
    >>> Hey everybody, I'm using CSS on my site and was just wondering if it
    >>> possible to use two different styles on two different <td> tags on
    >>> the same page? If so how?
    >>> Any help would be much appriciated.

    >>
    >>
    >> .td1 {border: 1px solid black;}
    >> .td2 {border: 5px dotted green;}
    >>
    >> <table>
    >> <tr>
    >> <td class="td1">foo</td>
    >> <td class="td2">foo</td>
    >> </tr>
    >> </table>
    >>

    > Better to use IDs:
    >
    > #td1 {border: 1px solid black;}
    > #td2 {border: 5px dotted green;}
    >
    > <table>
    > <tr>
    > <td id="td1">foo</td>
    > <td id="td2">foo</td>
    > </tr>
    > </table>


    Depending on whether they want to be able to do it more than once in the
    same page. If they only want to do it once, yes IDs would be better.

    --

    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Jul 10, 2003
    #5
  6. Blindsya

    Brian Guest

    Mark Parnell wrote:
    >>>.td1 {border: 1px solid black;}
    >>>.td2 {border: 5px dotted green;}
    >>>
    >>><table>
    >>><tr>
    >>><td class="td1">foo</td>
    >>><td class="td2">foo</td>
    >>></tr>
    >>></table>
    >>>

    >>Better to use IDs:
    >>
    >>#td1 {border: 1px solid black;}
    >>#td2 {border: 5px dotted green;}
    >>
    >><table>
    >><tr>
    >><td id="td1">foo</td>
    >><td id="td2">foo</td>
    >></tr>
    >></table>

    >
    > Depending on whether they want to be able to do it more than once in the
    > same page. If they only want to do it once, yes IDs would be better.


    If you don't need to use an id as a fragment url, what is the
    advantage of id over class?

    --
    Brian
    follow the directions in my address to email me
    Brian, Jul 10, 2003
    #6
  7. Blindsya

    Brian Guest

    Lauri Raittila wrote:
    >
    >>If you don't need to use an id as a fragment url, what is the
    >>advantage of id over class?

    >
    > Someone else can use them as fragment identifiers.


    you mean to bookmark a part of a document?

    --
    Brian
    follow the directions in my address to email me
    Brian, Jul 10, 2003
    #7
  8. In article <AY5Pa.19285$GL4.5669@rwcrnsc53>, Brian wrote:
    > Lauri Raittila wrote:
    > >
    > >>If you don't need to use an id as a fragment url, what is the
    > >>advantage of id over class?

    > >
    > > Someone else can use them as fragment identifiers.

    >
    > you mean to bookmark a part of a document?


    No, to post it to usenet ;-). When I quote, I always include first id
    upwards to the point I quote - way too often there is none in long time.
    If you use id instead if class when id is suitable, you make the id
    whitout thinking hard.

    Personally I believe that even every paragraph would benefit of id.
    Someday I'll write parser that do that automatically.

    There might be other reasons, but I don't think I have ever heard any
    better.

    --
    Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
    Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
    tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.
    Lauri Raittila, Jul 10, 2003
    #8
  9. On Thu, 10 Jul 2003 08:14:03 +0300, Lauri Raittila wrote:

    > Personally I believe that even every paragraph would benefit of id.
    > Someday I'll write parser that do that automatically.


    Disadvantage of that would be that when the document is edited (new
    paragraph is inserted, for example) then all the IDs would be renumbered,
    breaking any links to them.

    (Note to self: use more IDs)

    --
    Toby A Inkster BSc (Hons) ARCS | mailto: | pgp:0x6A2A7D39
    aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:
    http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
    playing://(nothing)
    Toby A Inkster, Jul 10, 2003
    #9
  10. In article <>, Toby A Inkster
    wrote:
    > On Thu, 10 Jul 2003 08:14:03 +0300, Lauri Raittila wrote:
    >
    > > Personally I believe that even every paragraph would benefit of id.
    > > Someday I'll write parser that do that automatically.

    >
    > Disadvantage of that would be that when the document is edited (new
    > paragraph is inserted, for example) then all the IDs would be renumbered,
    > breaking any links to them.


    So, it would be stupid to number those paragraphs, much better use few
    first words of paragraph to make ID. And, that would be possible using
    RegExp (in fact, I have one that makes it to headings somewhere), so it
    would even be easier. Only problem is possibility of identical id's when
    paragraphs start exactly same way. OTOH, then I would notice redundantly
    starting paragraphs using validator ;-)


    --
    Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
    Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
    tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.
    Lauri Raittila, Jul 14, 2003
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric
    Replies:
    4
    Views:
    688
    clintonG
    Dec 24, 2004
  2. tom watson

    print.css and screen.css

    tom watson, Sep 9, 2003, in forum: HTML
    Replies:
    1
    Views:
    448
    Jukka K. Korpela
    Sep 9, 2003
  3. Joshua Beall
    Replies:
    1
    Views:
    401
    Bertilo Wennergren
    Dec 10, 2003
  4. Noozer
    Replies:
    10
    Views:
    2,021
    Mitja
    Oct 13, 2004
  5. Titus A Ducksass - AKA broken-record
    Replies:
    6
    Views:
    631
    Titus A Ducksass - AKA broken-record
    Nov 15, 2004
Loading...

Share This Page