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

About CSS floating and canceling floating

Definition of Float Sets the element out of the n...

Summary of MySQL basic common commands

Table of contents MySQL basic common commands 1. ...

Detailed example of using case statement in MySQL stored procedure

This article uses an example to illustrate the us...

Whitespace processing in HTML/CSS and how to preserve whitespace in the page

Whitespace rules in HTML In HTML, multiple spaces...

A brief discussion on the corresponding versions of node node-sass sass-loader

Table of contents The node version does not corre...

Complete steps to install mysql5.7 on Mac (with pictures and text)

I recently used a Mac system and was preparing to...

Basic notes on html and css (must read for front-end)

When I first came into contact with HTML, I alway...

Getting Started Tutorial for Beginners ④: How to bind subdirectories

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

Writing a shell script in Ubuntu to start automatically at boot (recommended)

The purpose of writing scripts is to avoid having...

JavaScript function detailed introduction

Any number of statements can be encapsulated thro...

Introduction to Linux File Compression and Packaging

1. Introduction to compression and packaging Comm...

Implementation of Docker deployment of Tomcat and Web applications

1. Download docker online yum install -y epel-rel...