CODE PATH
PRO ACCOUNT

Master Code
On The Go

Learn. Practice. Build.

Quest 1 β€’ Lesson 7

🎨 CSS Basics

CSS (Cascading Style Sheets) controls the look and feel of your web pages: colors, fonts, spacing, layout. There are three ways to add CSS to HTML.

"HTML is the structure; CSS is the paint and decoration. Together they make beautiful websites."
inline.html
<h1 style="color: #60a5fa; font-size: 2rem;">Hello</h1>

πŸ“Œ Inline CSS

Uses the style attribute inside an HTML tag. Affects only that element. Good for quick tests, but not recommended for large projects.

πŸ”΅ This text is styled with inline CSS (blue, bold).

internal.html
<style>
  body { background-color: #0f172a; }
  h1 { color: #60a5fa; }
</style>

πŸ“Œ Internal CSS

Uses a <style> tag inside <head>. Applies to the whole page. Good for single‑page designs.

external.html
<link rel="stylesheet" href="styles.css">

πŸ“Œ External CSS

CSS in a separate .css file linked via <link>. Best for multi‑page websites – one file controls all pages.

🎨 Common CSS Properties

color – text colour
background-color – background colour
font-size – text size (px, rem, em)
font-family – typeface
margin – space outside element
padding – space inside element
border – border around element
text-align – left, center, right

This paragraph uses inline CSS: yellow text, dark background, padding, rounded corners.

✨ Challenge: Style a Card

Write internal CSS to create a card with:

❀️ Support Free Education

This course is 100% free. If it helps you, consider buying me a coffee.

β˜• Buy Me a Coffee

➑️ Ready for more?

Next lesson: CSS Box Model – margin, padding, border.

Continue to Lesson 1.8 β†’

(Coming soon – check back or buy Pro Pack for instant access)