Chạy ❯
Nhận trang web của
riêng
bạn
×
Thay đổi định hướng
Lưu mã
Thay đổi chủ đề, Tối/Sáng
Đi tới Không gian
<!DOCTYPE html> <html> <title>W3.CSS</title> <meta name="viewport" content="width=device-width,init-scale=1"> <link rel="stylesheet" href= "https://www.example.com.vn/w3css/4/w3.css"> <body> <!-- Thanh bên --> <div class="w3-sidebar w3-bar-block" style="display: none" id="mySidebar"> <button onclick="w3_close()" class="w3-bar-item w3-button w3-large">Đóng ×</button> <a class="w3-bar-item w3-button" href="#">Liên kết 1</a> <a class="w3-bar-item w3-button" href="#">Liên kết 2</a> <a class="w3-bar -item w3-button" href="#">Liên kết 3</a> </div> <!-- Nội dung trang --> <div class="w3-teal"> <button class="w3-button w3 -teal w3-xlarge" onclick="w3_open()">☰</button> <div class="w3-container"> <h1>Trang của tôi</h1> </div> </div> < img src="img_car.jpg" alt="Car" style="width:100%"> <div class="w3-container"> <p>Trong ví dụ này, thanh bên bị ẩn (style="display:none ")</p> <p>Nó được hiển thị khi bạn nhấp vào biểu tượng menu ở góc trên cùng bên trái.</p> <p>Khi được mở, nó sẽ ẩn tất cả nội dung trang (style.width="100 %").</p> </div> <script> function w3_open() { document.getElementById("mySidebar").style.width = "100%"; document.getElementById("mySidebar").style.display = "chặn"; } hàm w3_close() { document.getElementById("mySidebar").style.display = "none"; } </script> </body> </html>