SYP Start Your Path

Colors & CSS Basics

HTML Colors

<p style="color: red;">Named color</p>
<p style="color: #C41230;">Hex color</p>
<p style="color: rgb(196, 18, 48);">RGB color</p>
<p style="color: rgba(196, 18, 48, 0.5);">RGB with transparency</p>

This site itself uses hex colors as CSS variables — brand red #C41230, gold #F5A623, dark navy #1A1A2E — defined once and reused everywhere.

Introducing CSS

HTML defines structure; CSS defines how it looks. There are three ways to add CSS to HTML:

Inline — directly on one element (quick, but hard to maintain):

<p style="color: red; font-size: 18px;">Styled text</p>

Internal — inside a <style> block in <head> (fine for a single page):

<head>
  <style>
    p { color: red; font-size: 18px; }
  </style>
</head>

External — a separate .css file, linked in <head> (best practice for real sites — reusable across every page):

<head>
  <link rel="stylesheet" href="/assets/css/style.css">
</head>

This is exactly what real projects do — one shared style.css file, linked once, styling every page on the site consistently.