如何获得div的背景图像的锚标记? [英] How to get anchor tag on background image of div?

查看:80
本文介绍了如何获得div的背景图像的锚标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML:

HTML:

<div id="facey">
    <a href="http://www.facebook.com.au"></a>
</div>

css:

#facey {
    float: left;
    width: 32px;
    height: 32px;
    background: url(file:///C|/Users/User/Documents/TAFE%20-%20Web/ICAWEB411A%20Design%20simple%20web%20page%20layouts/testing%20color/icons/facey%20sprite.png) no-repeat 0 0;
}

#facey:hover {
    background-position: 0 -32px;
}

我有一个社交媒体图标的css精灵,我一直在努力把一个锚标签,他们去那里各自的网站,我不知道它是如何工作的,因为精灵图像被用作背景图像和锚标签似乎并没有在我的div内工作?

I have a css sprite for social media icons and I've been trying to put an anchor tag on them to go to there respective websites and I'm not sure how it works because the sprite images are used as background images and the anchor tag doesn't seem to work for me inside the div? I'm not to sure what im doing wrong here?

推荐答案

添加 CSS 样式 display:block; #facey a

这篇关于如何获得div的背景图像的锚标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆