class? underline link

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mr. Newt

    class? underline link

    Hi y'all,

    I'm looking to put an underline under some links but not under others. I
    still want an underline when the link is hovered over. I've dabbled with
    classes for this, but all I can get is line or no line.

    Any help?

    Thanks.

    Robert

    *************** *******

    <style>
    a.1{text-decoration:none }
    a.2{text-decoration:unde rline}
    </style>

    <a class="1" href="http://somewhere.com"T his link is not underlined...</a>

    <a class="2" href="http://www.somewhere.c om"This link IS underlined...</a>



  • John Hosking

    #2
    Re: class? underline link

    Mr. Newt wrote:
    >
    I'm looking to put an underline under some links but not under others. I
    still want an underline when the link is hovered over. I've dabbled with
    classes for this, but all I can get is line or no line.
    >
    <style>
    a.1 {text-decoration:none }
    a.2 {text-decoration:unde rline}
    a.1:hover {text-decoration:unde rline;}
    </style>
    >
    <a class="1" href="http://example.com"Thi s link is not underlined...</a>
    <a class="2" href="http://www.example.com "This link IS underlined...</a>
    Can't speak in favor of class names like "1" and "2", but if they're
    only example names, no problem.

    HTH

    --
    John
    Pondering the value of the UIP: http://blinkynet.net/comp/uip5.html

    Comment

    • Jonathan N. Little

      #3
      Re: class? underline link

      Mr. Newt wrote:
      Hi y'all,
      >
      I'm looking to put an underline under some links but not under others. I
      still want an underline when the link is hovered over. I've dabbled with
      classes for this, but all I can get is line or no line.
      >
      Any help?
      <style>
      a.1{text-decoration:none }
      a.2{text-decoration:unde rline}
      </style>
      >
      <a class="1" href="http://somewhere.com"T his link is not underlined...</a>
      >
      <a class="2" href="http://www.somewhere.c om"This link IS underlined...</a>
      Firstly, these are not valid class names, class names cannot begin with
      a number '0-9'




      So for what you wish, your style 2 is the default so there is no need to
      create a class and all we need to do is define a class for the
      non-underlined links...


      <style type="text/css">
      a.special:link { text-decoration: none; }

      /* underline when hoved & keyboard focus ... */
      a.special:hover ,
      a.special:focus ,
      a.special:activ e { text-decoration: underline; }

      </style>

      <a class="special" href="http://example.com"Thi s link is not
      underlined until hovered on in focus</a>

      <a href="http://www.example.com ">This link IS underlined...th e default</a>


      --
      Take care,

      Jonathan
      -------------------
      LITTLE WORKS STUDIO

      Comment

      • Jukka K. Korpela

        #4
        Re: class? underline link

        Scripsit Mr. Newt:
        I'm looking to put an underline under some links but not under
        others.
        Just stop wanting that. Links love underlines. Links want to be links.

        If you insist, though, learn how to use CSS and notice that this group is
        about HTML, not CSS. And don't forget the read the fine FAQs of
        comp.infosystem s.www.authoring.stylesheets before posting there.
        I still want an underline when the link is hovered over.
        So when the user _has_ recognized something as a link and has moved the
        pointer on it, _then_ you would let the browser show, in its default way,
        the usual clue of the text being a link. I wonder what makes people want
        such things. And why don't they want to set the color of the text to a
        typical link color but only _after_ the user has solved the puzzle?

        --
        Jukka K. Korpela ("Yucca")


        Comment

        • Mr. Newt

          #5
          Re: class? underline link


          "Jonathan N. Little" <lws4art@centra lva.netwrote in message
          news:e6200$4690 536f$40cba7b7$2 0366@NAXS.COM.. .
          Mr. Newt wrote:
          >Hi y'all,
          >>
          >I'm looking to put an underline under some links but not under others. I
          >still want an underline when the link is hovered over. I've dabbled with
          >classes for this, but all I can get is line or no line.
          >>
          >Any help?
          >
          ><style>
          > a.1{text-decoration:none }
          > a.2{text-decoration:unde rline}
          ></style>
          >>
          ><a class="1" href="http://somewhere.com"T his link is not
          >underlined.. .</a>
          >>
          ><a class="2" href="http://www.somewhere.c om"This link IS
          >underlined.. .</a>
          >
          Firstly, these are not valid class names, class names cannot begin with a
          number '0-9'
          >

          >
          >
          So for what you wish, your style 2 is the default so there is no need to
          create a class and all we need to do is define a class for the
          non-underlined links...
          >
          >
          <style type="text/css">
          a.special:link { text-decoration: none; }
          >
          /* underline when hoved & keyboard focus ... */
          a.special:hover ,
          a.special:focus ,
          a.special:activ e { text-decoration: underline; }
          >
          </style>
          >
          <a class="special" href="http://example.com"Thi s link is not underlined
          until hovered on in focus</a>
          >
          <a href="http://www.example.com ">This link IS underlined...th e default</a>
          >
          >
          --
          Take care,
          >
          Jonathan
          -------------------
          LITTLE WORKS STUDIO
          http://www.LittleWorksStudio.com
          Thanks. Just what I (my boss wanted) needed.


          Comment

          Working...