วัสดุ - สลับไอคอน
บทนี้อธิบายการใช้งานไอคอนสลับ (วัสดุ) ของ Google สมมติว่าcustom คือชื่อคลาส CSS ที่เรากำหนดขนาดและสีดังแสดงในตัวอย่างด้านล่าง
<!DOCTYPE html>
<html>
<head>
<link href = "https://fonts.googleapis.com/icon?family=Material+Icons" rel = "stylesheet">
<style>
i.custom {font-size: 2em; color: green;}
</style>
</head>
<body>
<i class = "material-icons custom">accessibility</i>
</body>
</html>
ตารางต่อไปนี้มีการใช้งานและผลลัพธ์ของไอคอน Toggle (วัสดุ) ของ Google แทนที่แท็ก <body> ของโปรแกรมด้านบนด้วยรหัสที่กำหนดในตารางเพื่อรับผลลัพธ์ตามลำดับ -
การใช้งาน | ผลลัพธ์ |
---|---|
<i class = "material-icons custom"> ช่องทำเครื่องหมาย </i> | check_box |
<i class = "material-icons custom"> check_box_outline_blank </i> | check_box_outline_blank |
<i class = "material-icons custom"> indeterminate_check_box </i> | indeterminate_check_box |
<i class = "material-icons custom"> radio_button_checked </i> | radio_button_checked |
<i class = "material-icons custom"> radio_button_unchecked </i> | radio_button_unchecked |
<i class = "material-icons custom"> star </i> | ดาว |
<i class = "material-icons custom"> star_border </i> | star_border |
<i class = "material-icons custom"> star_half </i> | star_half |