1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

prob: two different a href= styles

Discussion in 'HTML, Graphics & Programming' started by blade007, 11 Jul 2006.

  1. blade007

    Wise Guy

    Joined: 16 Jun 2003

    Posts: 1,862

    I'm needing to have a couple of options of formating the ahref= links, as I need the text to be two diffrent size depending upon where it is on the site.

    Is it possible? I've tried a few things .. but what looks good on IE, doesn't work on firefox.

    any ideas?
     
  2. Al Vallario

    Mobster

    Joined: 3 Aug 2005

    Posts: 4,534

    Location: UK

    Code:
    #firstplace a {
      /* Style */
    }
    
    #secondplace a {
      /* Style */
    }
    
    :confused:
     
  3. Sic

    Capodecina

    Joined: 9 Nov 2004

    Posts: 15,365

    Location: SO16

    define classes?

    Code:
    .thisOne a {
    style info here
    }
    .thatOne a {
    style info here
    }
    
    Code:
    <a href="blah.html" class="thisOne">blahdeeblah</a>
    <a href="bluh.html" class="thatOne">bluhdeebluh</a>
    
    just make sure that you haven't got any definitions of your a tags in any parent divs, or the formatting won't work (in my experience)
     
  4. Al Vallario

    Mobster

    Joined: 3 Aug 2005

    Posts: 4,534

    Location: UK

    I think you'll find thats:

    Code:
    a.thisOne {
    style info here
    }
    a.thatOne {
    style info here
    }
    
    av. ;)
     
  5. blade007

    Wise Guy

    Joined: 16 Jun 2003

    Posts: 1,862

    thanks fellas

    i'll give that a go
     
  6. Sic

    Capodecina

    Joined: 9 Nov 2004

    Posts: 15,365

    Location: SO16

    think you'll find they both work. i use my version on my site and it works perfectly
     
  7. Al Vallario

    Mobster

    Joined: 3 Aug 2005

    Posts: 4,534

    Location: UK

    The CSS you posted wouldn't work with the HTML you put it with. Your CSS declarations were essentially saying "For any anchor tag within an element with the class..." where they should say "For any anchor tag with the class..."

    Edit: Either that or there's some strange rule (which goes against common sense) I have overlooked :p
     
  8. Sic

    Capodecina

    Joined: 9 Nov 2004

    Posts: 15,365

    Location: SO16

    i haven't got the energy to check it - i'll take your word for it :p
     
  9. Augmented

    Soldato

    Joined: 18 Oct 2002

    Posts: 5,464

    Location: London Town

    Yes, a space is a descendant selector, so .thisOne a will only apply to any <a> element that is a descendant of an element with a class of "thisOne" :).
     
  10. blade007

    Wise Guy

    Joined: 16 Jun 2003

    Posts: 1,862

    thanks to all, your advice worked ... a little testing ... and it works brilliantly!

    not an easy thing to do .. and requires a little fiddling ... but hey!

    thanks again