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

Add and delete table information using javascript

Getting Started with JavaScript JavaScript is a l...

Sample code for implementing two-way authentication with Nginx+SSL

First create a directory cd /etc/nginx mkdir ssl ...

Solution to Docker image downloading too slowly

Docker image download is stuck or too slow I sear...

Tutorial on installing Apache 2.4.41 on Windows 10

1. Apache 2.4.41 installation and configuration T...

Detailed explanation of fetch network request encapsulation example

export default ({ url, method = 'GET', da...

How to disable IE10's password clear text display and quick clear function

IE10 provides a quick clear button (X icon) and a ...

Detailed explanation of Vue's keyboard events

Table of contents Common key aliases Key without ...

Solution to 404 error when downloading apk file from IIS server

Recently, when using IIS as a server, the apk fil...

Docker removes abnormal container operations

This rookie encountered such a problem when he ju...

Graphic tutorial on installing CentOS7 on VMware 15.5

1. Create a new virtual machine in VMware 15.5 1....

How to use Web front-end vector icons

Preface When writing front-end pages, we often us...

Some suggestions for Linux system optimization (kernel optimization)

Disable swap If the server is running a database ...

Summary of Vue watch monitoring methods

Table of contents 1. The role of watch in vue is ...

How to make your own native JavaScript router

Table of contents Preface Introduction JavaScript...

Getting Started Tutorial for Beginners ④: How to bind subdirectories

To understand what this means, we must first know ...