Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: h3 hover

  1. #1
    New Coder
    Join Date
    Apr 2005
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question h3 hover

    How would I make text underline in h3?

    My HTML looks like this:

    Code:
    <h3 class="block-click"><div class="title-name">New Albums</div></h3>
    css looks like this:

    Code:
    		h3 {
    			font:normal 100% Arial, sans-serif;
    			font-size:25px;
    			color: #fff;
    			height:30px;
    			margin: 5px 0px 0px 0px;
    			padding:5px;
    			letter-spacing:2px;
    			cursor:pointer;
    		}
    How would I make it so when you take your mouse over the h3 the text underlines?

  • #2
    New Coder
    Join Date
    Jan 2007
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's the code:

    Code:
    h3:hover {
    text-decoration: underline;
    }

  • #3
    New Coder
    Join Date
    Apr 2005
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thought I tried that.

    Thank you friend =)

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Hmm that will only work in browsers that aren't IE6. From the sounds of things though you intend on using onclick on the h3 or the div in order to make it a link. If that is the case then you are going about this the wrong way.
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    margin:0;
    padding:0;
    background:#000;
    }
    h3.block-click {
    font:normal 100% Arial, sans-serif;
    font-size:25px;
    line-height:30px;
    letter-spacing:2px;
    margin:5px 0 0;
    padding:5px;
    background:#CCC;
    }
    
    h3.block-click a {
    color:#FFF;
    display:block;
    text-decoration:none;
    }
    
    h3.block-click a:hover {
    text-decoration:underline;
    }
    </style>
    </head>
    
    <body>
    <h3 class="block-click"><a href="#">New Albums</a></h3>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Jan 2007
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hm. I didn't know that.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •