We Recommend

CSS: The Definitive Guide CSS: The Definitive Guide
Provides you with a comprehensive guide to CSS implementation, along with a thorough review of all aspects of CSS 2.1. Updated to cover Internet Explorer 7, Microsoft's vastly improved browser, this new edition includes content on positioning, text wrapping (nowrap), lists and generated content, table layout, user interface, paged media, and more.


Posted By

indianocean on 06/13/07


Tagged

css


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

blackabee


Create a "push button" effect, CSS only


Published in: CSS 


size of image: 80x20

  1. p.item{
  2. border: 1px solid #999;
  3. width: 80px;
  4. height: 20px;
  5. cursor: pointer;
  6. }
  7. p.item:hover{
  8. border: 2px solid #5A5A5A;
  9. width: 78px;
  10. height: 18px;
  11. }
  12.  
  13. Usage:
  14. <p class="item" onclick="doStuff()"><img src="image.png"/></p>

Report this snippet 

You need to login to post a comment.