「CSS」:beforeと:after文字の前後に固定で文字を追加する方法

説明
:before 疑似要素を使用するシンプルな例の1つ目は、引用符を追加するものです。
引用符を挿入するために :before および :after の両方を使用しています。
CSSコード

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
p:before {
content: "<";
color: green;
}
p:after {
content: ">";
color: yellow;
}
p:before { content: "<"; color: green; } p:after { content: ">"; color: yellow; }
p:before { 
  content: "<";
  color: green;
}

p:after { 
  content: ">";
  color: yellow;
}

htmlコード
<p>111111</p>

CSS

Posted by arkgame