Img semi-transparent processing Img plus semi-transparent background implementation ideas and code

Img semi-transparent processing Img plus semi-transparent background implementation ideas and code

Copy code
The code is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>mask-layer</title>
</head>
<style type="text/css">
*{margin:0;padding: 0;}
ul{margin:100px auto 0; width:200px;}
img{border: 0 none;}
li{background-color:#555;list-style: none; width: 146px; height: 220px;}
a:hover{opacity: 0.6;}
</style>
<body>
<ul>
<li><a href=""><img src="upload/2022/web/64380cd7912397dd9e0581b65982b2b7d0a28707.jpg" alt="" /></a></li>
</ul>
</body>
</html>

Principle : add a background to li, the size of li is the size of the image, and change the transparency of a when a:hover

<<:  Analysis of MySQL crash recovery based on Redo Log and Undo Log

>>:  This article summarizes the specific use of CSS two-column layout and three-column layout

Recommend

How to Install and Configure Postfix Mail Server on CentOS 8

Postfix is ​​a free and open source MTA (Mail Tra...

Detailed installation and configuration tutorial of PostgreSQL 11 under CentOS7

1. Official website address The official website ...

MySQL SQL statement analysis and query optimization detailed explanation

How to obtain SQL statements with performance iss...

Mysql solution to improve the efficiency of copying large data tables

Preface This article mainly introduces the releva...

How to deploy k8s in docker

K8s k8s is a cluster. There are multiple Namespac...

MySQL 5.7.27 installation and configuration method graphic tutorial

The installation tutorial of MySQL 5.7.27 is reco...

CSS3 realizes the animation of shuttle starry sky

Result: html <canvas id="starfield"&...

How to use @media in mobile adaptive styles

General mobile phone style: @media all and (orien...

Tutorial on how to install and use Ceph distributed software under Linux

Table of contents Preface 1. Basic Environment 1....

Detailed explanation of Linux zabbix agent deployment and configuration methods

1. Install zabbix-agent on web01 Deploy zabbix wa...

Vue Element-ui form validation rule implementation

Table of contents 1. Introduction 2. Entry mode o...

How to implement CSS mask full screen center alignment

The specific code is as follows: <style> #t...

Summary of important mysql log files

Author: Ding Yi Source: https://chengxuzhixin.com...

Detailed explanation of virtual DOM in Vue source code analysis

Why do we need virtual dom? Virtual DOM is design...