Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Image border hover change
Old 11-08-2007, 12:17 AM Image border hover change
Skilled Talker

Posts: 89
Trades: 0
Ok so I want to do a mouse over where the border color around a pic. changes. I don't know how to do this with valid xhtml. Ok if I didn't need it valid it would be simple but look at the code I have and please explain.

Code:
<a href="/Blue/index.php">
    <img src="Images/bluethum.jpg" class="thum" alt="Click for working version" />
    </a>  
    <p class="paragraph">This is an example of a template I can code and design. This template sold for 100 dollars, so that is an example of a one page layout price range, however prices can go down and up depending on many factors. As you can see it is very clean and simple enough to look good for any type of website.</p>
    <hr />
    <br />
Code:
.thum {

  border: 3px solid #ec851f;

}

.thum a:hover {

  border: 3px solid #793f00;

}
Because the link surrounds the image and is not a part of it it gets screwed up when I put the class .thum in the <a> but the border doesn't change colors now.
__________________

Please login or register to view this content. Registration is FREE
Bouzy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-08-2007, 02:13 AM Re: Image border hover change
Experienced Talker

Posts: 49
Trades: 0
what i would do is

Code:
 img 
{border: none;
}
img a
{border: 3px solid #ec851f;
}
img a:hover
{border: 3px solid #793f00;
}
of course that would make all imgs inside a link surrounded by those borders, and the hover effect as well.

however, the way you have it now would work just remove the class="thum" from the img, put it in the <a> tag, and it should work, but make sure you still have this in your css

Code:
 img 
 {border: none;
 }
Regards,
Cy.
Cyrus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Image border hover change
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09620 seconds with 12 queries