Results 1 to 11 of 11

Thread: Links in HTML

  1. #1

    Thread Starter
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196

    Links in HTML

    Simple one - hopefully.

    Anyone tell me how to create hyperlinks in HTML which do not get underlined as standard?

    I want www.mywebpage.com to be without underline.

    Simple ya? Hope so.
    Thanks

    HD

  2. #2
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057

    Re: Links in HTML

    Originally posted by HairyDave
    I want www.mywebpage.com to be without underline.
    with CSS:
    Code:
    <a href="http://www.mywebpage.com" style="text-decoration:none;">www.mywebpage.com</a>
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  3. #3

    Thread Starter
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196
    Nice. Thanks for that

    HD

  4. #4
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    You could also create a class for that if you want to use it on multiple links:

    Code:
    <head>
      <style type="text/css"><!--
        a.noU { text-decoration: none; }
      --></style>
    </head>
    
    <body>
      <a href="#" class="noU">asd</a>

  5. #5
    Junior Member
    Join Date
    Oct 2002
    Posts
    21
    Originally posted by Rick Bull
    You could also create a class for that if you want to use it on multiple links:

    Code:
    <head>
      <style type="text/css"><!--
        a.noU { text-decoration: none; }
      --></style>
    </head>
    
    <body>
      <a href="#" class="noU">asd</a>
    sorry can expline this
    with a real example

    thinks
    ThiS Is Me
    my email
    [email protected]

  6. #6
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Originally posted by newDay
    sorry can expline this
    with a real example

    thinks
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    
    
    <head>
      <style type="text/css"><!--
        a.noU { text-decoration: none; }
      --></style>
    </head>
    
    <body>
      <a href="#" class="noU">link1</a>
      <a href="#" class="noU">link2</a>
      <a href="#" >link3</a>
    </body>
    
    </HTML>
    How much do you need explained? I'm going to assume you understood my post with the "inline" style. When you put the style in the head as shown you can assign it to a class and give it to multiple elements. So, if you notice in the example I have two links set to that class... they will not have the text decoration but the third link which has no class (pun not intended ) will be underlined. "a.noU" is two parts the a means "apply this to all a tags (links) that are of class "noU"
    hope that helps, if not just post
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  7. #7

    Thread Starter
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196
    Cheers for that - don't suppose you could tell me how to get a link to change colour when the mouse hovers above the link? I know you can declare javaScript for the onMouseOver - is this the way to do it?

    If so, could you give a very simple example of it - and if not what is the way?

    Thanks very much

    HD

  8. #8
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Code:
    .catlink {color: #000000;}
    .catlink:hover {color: #ffffff;}

    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  9. #9

    Thread Starter
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196
    Sorry to be so dense, how does this fit in with the example you gave before. I have tried this:

    Code:
    <head>
      <style type="text/css"><!--
        a.noU { text-decoration: none; }
        a.catlink {color: #000000;}
        a.catlink:hover {color: #ffffff;}
      --></style>
    </head>
    Is this right? I don't seem to be able to get the link to change colour.

    Any help would be gratefully received.

    HD

  10. #10
    Frenzied Member msimmons's Avatar
    Join Date
    Jul 2001
    Location
    Houston, TX
    Posts
    1,057
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    
    
    <head>
      <style type="text/css"><!--
        a.noU { text-decoration: none; }
        a.catlink {color: #000000;}
        a.catlink:hover {color: #ffffff;}
      --></style>
    </head>
    
    <body>
      <a href="#" class="noU">link1</a>
      <a href="#" class="noU">link2</a>
      <a href="#" class="catlink">link3</a>
    </body>
    
    </HTML>
    will cause link 3 to have the rollovers but I assume that you want the underline & rolover on the same link:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    
    
    <head>
      <style type="text/css"><!--
        a.noU { text-decoration: none; color: #000000;}
        a.noU:hover { text-decoration: none; color: #ffffff;}
      --></style>
    </head>
    
    <body>
      <a href="#" class="noU">link1</a>
      <a href="#" class="noU">link2</a>
      <a href="#" >link3</a>
    </body>
    
    </HTML>
    no need for appoligies... only way to learn is to ask and I was quite obsure in my post
    Michael
    I'm off to GalahTech, hope to see you there.

    If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.

  11. #11

    Thread Starter
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196


    Cheers mate - works like a dream. Unfortunately I haven't done much of this before so I'm a bit of a beginner trying to get it done quickly - isn't it always the way - for a project.

    Thanks again.

    HD

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