Styling Text with the After Pseudo-element
📖 Scenario: You are creating a simple webpage that shows a list of fruits. You want to add a small decorative text after each fruit name to make the list more interesting.
🎯 Goal: Build a webpage with a list of fruits. Use the CSS after pseudo-element to add the text " (fresh)" after each fruit name.
📋 What You'll Learn
Create an unordered list with three fruit names: Apple, Banana, Cherry
Add a CSS rule that uses the
after pseudo-element on each list itemThe
after pseudo-element should add the text " (fresh)" after each fruit nameUse semantic HTML and ensure the CSS is valid and linked correctly
💡 Why This Matters
🌍 Real World
Adding small decorative or informative text after elements is common in web design to improve user experience and visual appeal.
💼 Career
Understanding and using CSS pseudo-elements like after is essential for front-end developers to create polished and accessible web interfaces.
Progress0 / 4 steps