CSS를 사용하면 배경, 목록 스타일 속성, 글꼴 스타일 등을 지정하여 목록의 스타일을 지정할 수 있습니다. 목록 스타일 속성은 목록 스타일 유형, 목록 스타일을 지정하기 위한 약어입니다. -image 및 list-style-position을 같은 순서로 지정합니다.
구문
CSS 목록 스타일 속성의 구문은 다음과 같습니다 -
Selector { list-style: /*value*/ }
예시
다음 예는 목록의 스타일을 보여줍니다 -
<!DOCTYPE html> <html> <head> <style> ul { display: flex; float: left; list-style-image: url("https://www.tutorialspoint.com/images/reactjs.png"); background: lightseagreen; list-style-position: inside; } li { background: azure; margin: 5px 20px; } </style> </head> <body> <h3>ReactJS</h3> <ul> <li>Lesson 1</li> <li>Lesson 2</li> <li>Lesson 3</li> <li>Lesson 4</li> <li>Lesson 5</li> </ul> </body> </html>
출력
이것은 다음과 같은 출력을 제공합니다-
예시
<!DOCTYPE html> <html> <head> <style> ol { width: 40%; color: white; list-style: lower-greek inside; background-image: url("https://www.tutorialspoint.com/ethereum/images/ethereum-mini-logo.jpg"); } li { background-color: rgba(0,0,0,0.6); margin: 5px 30px; } </style> </head> <body> <h2>Ethereum</h2> <ol> <li>Smart Contracts</li> <li>Ganache</li> <li>Creating Wallet </li> <li>Deploying Contract</li> </ol> </body> </html>
출력
이것은 다음과 같은 출력을 제공합니다 -