Guest User

Untitled

a guest
Aug 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. /* the idea here is to create a link with an image AND some text,,,, but ONLY the text gets underlined*/
  2.  
  3. /* with this setup and CSS it is not possible to take out the underline of the img element (since it is an in-line element)*/
  4.  
  5. <a href=#><img src="path/to/file" /> some text</a>
  6.  
  7. /* Because 'a' styling is supposed to have text-decoration:underline; and that affects the image too....
  8.  
  9. even with:
  10.  
  11. a img {text-decoration:none;}
  12.  
  13. */
  14.  
  15. so the hack comes here.... CSS this: .imagelink{text-decoration:none}
  16.  
  17. and in HTML: <a href=# class="imagelink"><img src="path/to/file" /> <u>some text</u></a>
  18.  
  19. where we can see how useful the <u> is....
Add Comment
Please, Sign In to add comment