Class selector, ID selectors and link pseudo-classes

Discussion in 'HTML' started by Luigi Donatello Asero, Jun 4, 2005.

  1. Does the following define the colour of all the visited links belonging to
    the div class "subsection" which have an id selector "semesterbostader"?
    div.subsecttion#semesterbostader > A:visited { color: blue }

    --
    Luigi ( un italiano che vive in Svezia)
    https://www.scaiecat-spa-gigi.com/sv/valkommen.php
     
    Luigi Donatello Asero, Jun 4, 2005
    #1
    1. Advertising

  2. Luigi Donatello Asero

    Gazza Guest

    Luigi Donatello Asero mumbled the following on 04/06/2005 15:21:
    > Does the following define the colour of all the visited links belonging to
    > the div class "subsection" which have an id selector "semesterbostader"?
    > div.subsecttion#semesterbostader > A:visited { color: blue }


    Yes, although with ID's having to be unique on a page, you could simply
    drop the div.subsecttion bit:
    #semesterbostader > a:visited { color: blue; }

    --
    Gazza
    Mobile Number Network Checker - http://mnnc.net/
    Creative writing & Poems - http://garyjones.co.uk/
    Leovanna Leonbergers - http://leovanna.co.uk/
     
    Gazza, Jun 4, 2005
    #2
    1. Advertising

  3. "Gazza" <> skrev i meddelandet
    news:mIjoe.8176$...
    >
    >
    > Luigi Donatello Asero mumbled the following on 04/06/2005 15:21:
    > > Does the following define the colour of all the visited links belonging

    to
    > > the div class "subsection" which have an id selector "semesterbostader"?
    > > div.subsecttion#semesterbostader > A:visited { color: blue }

    >
    > Yes, although with ID's having to be unique on a page, you could simply
    > drop the div.subsecttion bit:
    > #semesterbostader > a:visited { color: blue; }



    I tried this one
    #italien > A:visited { display:none;}
    but the visited link will be displayed on the page
    https://www.scaiecat-spa-gigi.com/sv/test.html

    Why?


    --
    Luigi ( un italiano che vive in Svezia)
    https://www.scaiecat-spa-gigi.com/it/svezia.html
     
    Luigi Donatello Asero, Jun 4, 2005
    #3
  4. Luigi Donatello Asero

    Toby Inkster Guest

    Gazza wrote:

    > Yes, although with ID's having to be unique on a page, you could simply
    > drop the div.subsecttion bit:
    > #semesterbostader > a:visited { color: blue; }


    Not neccessarily. On one page there might be:

    <div id="semesterbostader" class="subsection">

    and on another page, linked with the same stylesheet:

    <div id="semesterbostader" class="flibble">

    and on another page, linked with the same stylesheet:

    <p id="semesterbostader" class="subsection">

    So it might pay to be specific and include the element name and class.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Jun 4, 2005
    #4
  5. "Luigi Donatello Asero" <> skrev i meddelandet
    news:ynkoe.139435$...
    >
    > "Gazza" <> skrev i meddelandet
    > news:mIjoe.8176$...
    > >
    > >
    > > Luigi Donatello Asero mumbled the following on 04/06/2005 15:21:
    > > > Does the following define the colour of all the visited links

    belonging
    > to
    > > > the div class "subsection" which have an id selector

    "semesterbostader"?
    > > > div.subsecttion#semesterbostader > A:visited { color: blue }

    > >
    > > Yes, although with ID's having to be unique on a page, you could simply
    > > drop the div.subsecttion bit:
    > > #semesterbostader > a:visited { color: blue; }

    >
    >
    > I tried this one
    > #italien > A:visited { display:none;}
    > but the visited link will be displayed on the page
    > https://www.scaiecat-spa-gigi.com/sv/test.html
    >
    > Why?



    I think I understood it!
    It seems to work now.
    I have to use ">" only if to indicate a child but not a descendant
    selector!
    a.visited is no child, only a descendant selector of div
    id="semesterbostader">



    --
    Luigi ( un italiano che vive in Svezia)
    https://www.scaiecat-spa-gigi.com/it/svezia.html
     
    Luigi Donatello Asero, Jun 4, 2005
    #5
    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. Matt Beckwith

    Class and ID Selectors (CSS question)

    Matt Beckwith, Jul 12, 2003, in forum: HTML
    Replies:
    3
    Views:
    382
    David Dorward
    Jul 13, 2003
  2. Luigi Donatello Asero
    Replies:
    1
    Views:
    402
    Luigi Donatello Asero
    Jun 4, 2005
  3. FC
    Replies:
    1
    Views:
    939
  4. Gabriele Marrone

    RubyCocoa - selectors for Ruby classes

    Gabriele Marrone, Nov 3, 2006, in forum: Ruby
    Replies:
    1
    Views:
    122
    Harry
    Jan 24, 2007
  5. friday13
    Replies:
    3
    Views:
    199
    friday13
    Apr 28, 2007
Loading...

Share This Page