Agyan
adda
Run
Reset
Copy
CSS Tutorial › CSS Pseudo-elements › ::before, ::after and ::first-letter
Back to tutorial
Code
Edit, then press Run or Ctrl+Enter
<style> .tip::before { content: "💡 "; } .required::after { content: " *"; color: crimson; } .story::first-letter { font-size: 2.5em; color: #1f386b; float: left; line-height: 1; margin-right: 6px; } ::selection { background: #ffd43b; } </style> <p class="tip">Use DevTools to inspect CSS.</p> <p class="required">Email</p> <p class="story">Once upon a time, a developer learned CSS and built beautiful websites. Select this text to see the custom highlight.</p>
Result