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> 出力
-
::markerCSSSelectorを使用してリストの箇条書きの色を変更する
構文 CSS::マーカーセレクターの構文は次のとおりです- Selector::marker { attribute: /*value*/; } 例 次の例は、CSS::マーカーセレクターを示しています。 <!DOCTYPE html> <html> <head> <style> ul { list-
-
CSSでテキストボックスのプレースホルダーの色を変更する方法
::placeholder疑似要素を使用して、テキストボックスのプレースホルダーテキストの色を変更できます。 CSS::placeholder疑似要素の構文は次のとおりです- ::placeholder { attribute: /*value*/ } 例 次の例は、CSS::プレースホルダー疑似要素を示しています。 <!DOCTYPE html> <html> <head> <style> input:last-child::placeholder { color: cornflowerblue; } <