Learn this written chapter step-by-step alongside the CodeToCareer series.
Zero experience needed. Learn how CSS (Cascading Style Sheets) paints colors, fonts, margins, and borders onto raw HTML elements.
If HTML is the plain concrete foundation and brick walls of a house, CSS is the interior designer that paints the walls crimson, adds soft lighting, and positions the furniture.
Without CSS, every webpage on the internet looks like a plain black-and-white 1990s Word document. CSS (Cascading Style Sheets) is what makes the web look beautiful, sleek, and modern.
Every CSS rule has 3 parts:
h1, p, button)color, background-color, font-size)red, #070709, 24px)/* Selector */
h1 {
color: #e11d48; /* Property: Value; */
font-size: 32px;
text-align: center;
}<p style="color: red;">Text</p> (Quick tests, but messy).<head> of an HTML file.style.css file and linked using <link rel="stylesheet" href="style.css">.Think of CSS selectors like pointing a magic paintbrush: 'Paint all <h1> titles red, and give all <button> elements rounded corners!'