Home  >  Article  >  Web Front-end  >  Picture as background and link writing method (background picture plus link)_HTML/Xhtml_Web page production

Picture as background and link writing method (background picture plus link)_HTML/Xhtml_Web page production

WBOY
WBOYOriginal
2016-05-16 16:37:561742browse

The picture is used as the background and the link is written. For example, the website’s logo image. For example: Potato’s logo picture

http://www.jb51.net">Tudou

a {display: block;width: 170px;height: 42px;text-indent: -9999px;background: url(/skin/__g/img/ui/nav/v2_v6.png) 0 0 no-repeat;}
Due to z-indent, the words Tudou.com will not be displayed. The title attribute is the text that will be displayed when the mouse is pointed.
link background image is not fully displayed under normal circumstances, because the link is an inline element, and the width height attribute in the a tag css is invalid.

The improvement method is to use display:block; or display:inline-block; in CSS and then set width and height.