开发者

how to add a link to the background image in the css code

开发者 https://www.devze.com 2023-01-16 14:02 出处:网络
this is the css code #header #phone{ background: url(../images/icon.jpg) no-repeat right 0px; position: absolute;

this is the css code

#header #phone{
  background: url(../images/icon.jpg) no-repeat right 0px; 
  position: absolute;
  top: 41px;
}

my question is how can I add a link to the icon.jpg ima开发者_如何学编程ge

thanks


one of the tricks is :

http://xavisys.com/css-trick-turning-a-background-image-into-a-clickable-link/

make the link the same size as the image . Since an anchor tag isn’t a block level element, we need to force it to display as “block" & hide the text. This can be done using “text-indent” and indenting the text completely off.

0

精彩评论

暂无评论...
验证码 换一张
取 消