Anchor hover image style : Anchor « Tags « HTML / CSS






Anchor hover image style

 

<!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" lang="en">
    <head>
        <title></title>
<style type="text/css">
img {
  width: 300px;
  border: 6px double #666;
  background: #fff;
  padding: 4px;
  display:block;
}

a:link {
  display:block;
}

a:hover img {
  border-style: solid;
  background: #999;
  }

</style>

    </head>
    <body>

<a href="http://www.java2s.com"><img src="http://www.java2s.com/style/logo.png" alt="Face" /></a>
    </body>
</html>

 








Related examples in the same category

1.Introduction to hyperlinks
2.'link' defines relationship between the current page and external documents
3.A basic link to another page
4.A basic link to an external web site
5.A link with a title attribute
6.A link with white space
7.a name = ".."> creates an internal hyperlink
8.Anchor element
9.relative link
10.background image, repeat and position for anchor link
11.avoid underlining links
12.Set border for an anchor with
  • under
  • 13.Set text-decoration to none for
    14.Set cursor for anchor link and visted
    15.Set text decoration for anchor
    16.Set background for anchor
    17.Four level nesting for anchor style setting
    18.Using Links - Changing Backgrounds
    19.Using Links with Background Images
    20.Image links
    21.anchor style for removing the underline
    22.Add text decoration for link
    23.Add background image to anchor link
    24.List with anchor
    25.Using images as link anchors
    26.text-decoration, color, background-color for hover anchor