html css:背景图片连接css写法

图片做为背景,而且是连接的写法。例如网站的logo图片。例如:土豆的logo图片css

<a title="土豆网 tudou.com 每一个人都是生活的导演" href="http://www.tudou.com">土豆网</a>html

a { displayblock; width170px; height42px; text-indent-9999px; backgroundurl(/skin/__g/img/ui/nav/v2_v6.png) 0 0 no-repeat;}
因为z-indent的缘由土豆网三个字是不会显示的。title属性是鼠标指向会显示的文本。

<a><span>连接背景图片,在正常状况下是显示不全的,由于<a>连接是行内元素,而且对于a标签css中width height属性失效。web

改进方法,就是css中display:block;或者display:inline-block;而后设置width和height。网站

相关文章
相关标签/搜索