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로 목록의 글머리 기호 색상을 변경하는 방법은 무엇입니까?