Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

จะเปลี่ยนสีสัญลักษณ์แสดงหัวข้อย่อยสำหรับรายการด้วย CSS ได้อย่างไร


ในการเปลี่ยนสีสัญลักษณ์แสดงหัวข้อย่อยสำหรับรายการด้วย CSS โค้ดจะเป็นดังนี้ -

ตัวอย่าง

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
   body{
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
   }
   ul {
      list-style: none;
   }
   ul li{
      font-size: 20px;
      font-weight: 500;
   }
   ul li::before {
      content: "\2022";
      color: rgb(86, 18, 117);
      font-weight: bold;
      display: inline-block;
      width: 1em;
      margin-left: -1em;
}
</style>
</head>
<body>
<h1>Change Bullet Color of List Example</h1>
<ul>
<li>Camel</li>
<li>Goat</li>
<li>Giraffe</li>
<li>Lion</li>
</ul>
</body>
</html>

ผลลัพธ์

โค้ดด้านบนจะสร้างผลลัพธ์ต่อไปนี้ -

จะเปลี่ยนสีสัญลักษณ์แสดงหัวข้อย่อยสำหรับรายการด้วย CSS ได้อย่างไร