JSFiddle - React, Tailwind, and code Playground

by Tìm ở đây Khoá học CNTT

HTML

<h1>Image Transparency</h1>
<p>Thuộc tính opacity thường được sử dụng cùng với bộ chọn :hover để thay đổi độ trong suốt của hình ảnh khi di chuyển chuột vào:</p>

<img src="https://timoday.edu.vn/wp-content/uploads/2021/04/img_forest.jpg" alt="Forest" width="170" height="100">
<img src="https://timoday.edu.vn/wp-content/uploads/2021/04/img_mountains.jpg" alt="Mountains" width="170" height="100">
<img src="https://timoday.edu.vn/wp-content/uploads/2021/04/img_5terre.jpg" alt="Italy" width="170" height="100">

CSS

img {
  opacity: 0.5;
}

img:hover {
  opacity: 1.0;
}