Bộ chọn loại phần tử CSS được sử dụng để chọn tất cả các phần tử của một loại. Cú pháp cho bộ chọn loại phần tử CSS như sau
Cú pháp
element { /*declarations*/ }
Ví dụ
Các ví dụ sau minh họa bộ chọn loại phần tử CSS
<!DOCTYPE html> <html> <head> <style> li { list-style: none; margin: 5px; border-bottom-style: dotted; } div { box-shadow: inset 0 0 8px plum; padding: 36px; } </style> </head> <body> <div> <pre> \(╪)(╪) /</pre> <ul> <li></li> <li></li> </ul> </div> </body> </html>
Đầu ra
Điều này cho kết quả sau -
Ví dụ
<!DOCTYPE html> <html> <head> <style> li { text-align: center; list-style: none; margin: 5px; padding: 5px; box-shadow: inset 0 0 15px yellowgreen; } div { box-shadow: inset 0 0 8px orange; padding: 36px; width: 30%; border-radius: 50%; } </style> </head> <body> <div> <ul> <li>Hello</li> <li>Guys</li> </ul> </div> </body> </html>
Đầu ra
Điều này cho kết quả sau -