Skip to main content

Connecting a CSS Stylesheet

CSS controls presentation while HTML provides structure.

Connect the file

Create css/style.css, then add this inside the page’s <head>:

A relative path is interpreted from the current page. A PHP page in a subfolder may need a different path.

Test the connection

body {
  font-family: Arial, sans-serif;
  color: #1f2933;
  background: #f7f9fc;
}

Refresh without cache if an old version remains.

Good practice

Keep reusable rules in external stylesheets. Avoid large blocks of inline CSS and do not use colour as the only way to communicate meaning.

Check