First styled profile
Definition and purpose
A styled profile combines semantic HTML with a small set of rules. Use headings for names or sections, paragraphs for descriptions and meaningful link text. CSS can create a consistent appearance without duplicating markup or removing useful semantics.
Small profile
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> body { font-family: sans-serif; background-color: white; } h1 { color: navy; font-size: 28px; } p { color: navy; } </style> </head> <body> <main> <h1 id="a">Mina Rahimi</h1> <p id="b">Illustrator and gardener.</p> <a href="#bio">Read the biography</a> <p id="bio">I draw plants.</p> </main> </body></html>The heading is distinct, text is readable on white, and the link retains its native behavior.
Syntax and mental model
Start with HTML that works without CSS. Set a readable font family on body (inherited by most text descendants), a size and color for headings, and readable colors for paragraphs. font-family: sans-serif requests a generic font family. font-size: 20px specifies a CSS length; the values chapter will explain units. Keep native links recognizable and preserve focus indicators.
Profile update
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS practice</title> <style> body { font-family: sans-serif; } h1 { color: navy; font-size: 30px; } h2 { color: green; } p { color: navy; font-size: 18px; } </style> </head> <body> <main> <h1 id="a">Studio Atlas</h1> <p id="b">Print and illustration.</p> <h2 id="c">Work</h2> <a href="#work">See the work</a> <p id="work">Posters and books.</p> </main> </body></html>Separate heading rules create a visible hierarchy while maintaining the HTML structure.
Common mistakes
Avoid hard-to-read foreground/background combinations, tiny text and removing link underlines without an equivalent cue. Do not use a heading just because it looks large; choose its semantic rank.
Practice and next steps
After trying the examples, complete the linked coding exercise and review questions. Predict the result before running your code. Prerequisite: Browser defaults and developer tools. Next lesson: Type, class, ID and universal selectors.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
First styled profile — knowledge check
Five questions on first styled profile.
What should determine whether text is a heading?
What does font-family: sans-serif request?
What is a suitable way to distinguish the profile name?
Why preserve visible link cues?
Which change makes paragraphs 18px without changing h1?