You can create a webpage with a single HTML file.

index.html

An HTML file contains the content and structure of a webpage. The name index.html is commonly used for the main page of a website.

When someone visits a website without requesting a specific file, the web server will usually look for index.html and load it automatically.

You can place CSS inside the HTML file, but it is usually clearer to keep the styles in a separate CSS file.

style.css

Your starting folder might contain these two files:

index.html
style.css

Separating HTML and CSS makes the project easier to read and organize, especially as the amount of code grows.

To use the styles from style.css, add this line inside the <head> section of index.html:

<link rel="stylesheet" href="style.css">

The <head> contains information the browser needs before displaying the page. The href attribute tells the browser where to find the CSS file.

If index.html and style.css are in the same folder, the file path style.css will work without any changes.

AI Tutor