JSFiddle - React, Tailwind, and code Playground
by CaoThiHat
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Seletor theo nhóm</title>
</head>
<body>
<h1>Selector theo nhóm (bài 57-selector theo nhóm)</h1>
<a href="https://unitop.vn/course/html-css-21-ngay-thanh-thao-xay-dung-giao-dien-web-thuc-te-tu-ban-thiet-ke-photoshop/lecture/839">Selector theo nhóm</a>
<h2>Từ mới</h2>
group: Nhóm, tập hợp
<h2>Nội dung</h2>
-Các selector cùng một nội dung style ta có thể chọn và khai báo như sau (bị chon style gồm nhiều selector thì các selector cách nhau bởi dấu phẩy)
<code>
<textarea name="" id="" cols="80" rows="7">
<style>
selector1, selector2,...., selectorn{
Nội dung cần style
}
</style>
</textarea>
</code>
<br/>
Ví dụ
<br>
cùng selector cho p và h3 ta có đoạn code như sau:
<br>
<code>
<textarea name="" id="" cols="80" rows="7">
<style>
h3, p{
color: red;
}
</style>
</textarea>
</code>
<br/>
<style>
h3, p{
color: red;
}
</style>
Kết quả
<br/>
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Debitis aut repudiandae facilis! In sint, fuga provident quae quo eius. Tempora?</h3>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Est sit illo in ipsa quos magni perspiciatis inventore, consequatur quisquam! Voluptate odio corrupti veniam incidunt minima. Eaque reiciendis sit at qui!</p>
</body>
</html>