Guest User

Untitled

a guest
Jun 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <a href="#"><img src="image.png" /></a> ==> this should not have a bottom-border on hover
  2. <a href="#">regular text link</a> ==> this should have a bottom-border on hover
  3.  
  4. #sidebar a:hover {
  5. border-bottom: 1px dotted red;
  6. }
  7. #sidebar a:hover img {
  8. border-bottom: none;
  9. }
  10.  
  11. #sidebar a:hover { text-decoration: underline; }
  12. #sidebar a:hover img { text-decoration: none; }
  13.  
  14. a img {position:relative; top: Npx}, where N is the hover border thickness
  15.  
  16. $('#sidebar a:has(img)').addClass('image-link');
  17.  
  18. #sidebar a:hover {
  19. border-bottom: 1px dotted red;
  20. }
  21. #sidebar a.image-link:hover {
  22. border-bottom: none;
  23. }
  24.  
  25. $text = preg_replace('#<a(.*?)<img(.*?)/>(.*?)</a>#is', "<a class='imgshow' \1 <img\2 />\3</a>", $text);
Add Comment
Please, Sign In to add comment