How to write a picture as a background and a link (background picture plus link)

How to write a picture as a background and a link (background picture plus link)

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

<a title="Tudou.com Everyone is the director of life" href="https://www.jb51.net">Tudou.com</a>

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 three words "Tudou.com" will not be displayed. The title attribute is the text that will be displayed when the mouse is pointing at it.
The background image of the <a><span> link is not fully displayed under normal circumstances, because the <a> link is an inline element and the width and height attributes in the a tag CSS are invalid.

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

<<:  Detailed steps for installing nodejs environment and path configuration in Linux

>>:  Some issues we should pay attention to when designing a web page

Recommend

Linux Jenkins configuration salve node implementation process diagram

Preface: Jenkins' Master-Slave distributed ar...

How to recover data after accidentally deleting ibdata files in mysql5.7.33

Table of contents 1. Scenario description: 2. Cas...

react-diagram serialization Json interpretation case analysis

The goal of this document is to explain the Json ...

A complete guide to Linux environment variable configuration

Linux environment variable configuration When cus...

WeChat applet custom bottom navigation bar component

This article example shares the specific implemen...

Diving into JS inheritance

Table of contents Preface Prepare Summarize n way...

MySQL query learning basic query operations

Preface MySQL is the most popular relational data...

Detailed explanation of Object.create instance usage in js

1. Create a new object using the Object.create() ...

js to realize the mouse following game

This article shares the specific code of js to im...

JavaScript String Object Methods

Table of contents Methods of String Object Method...

Detailed explanation of 8 ways to pass parameters in Vue routing components

When we develop a single-page application, someti...

How to configure nginx to limit the access frequency of the same IP

1. Add the following code to http{} in nginx.conf...

MySQL 8.0 DDL atomicity feature and implementation principle

1. Overview of DDL Atomicity Before 8.0, there wa...

Detailed steps for developing Java payment interface for Alipay

Table of contents first step Step 2 Step 3 Step 4...