<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
div.example {
background-color: yellow;
padding: 20px;
}
@media screen and (max-width: 600px) {
div.example {
display: none;
}
}
</style>
</head>
<body>
<h2> Ẩn các phần tử trên các kích thước màn hình khác nhau </h2>
<div class="example">Hello World!</div>
<p>Khi chiều rộng của trình duyệt rộng từ 600px trở xuống, phần tử div sẽ bị ẩn. Thay đổi kích thước cửa sổ trình duyệt để xem hiệu ứng</p>
</body>
</html>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.