HTML, CSS, and hosting a website
March 15, 2027
Websites are simply servers that deliver files upon request.
They return HTML files: HyperText Markup Language
The benefits of HTML
Technically, servers can return any file type, and often will return .json, .pdf, images, etc. But .html files are the most common.
HTML files are static.
This means that when you request a specific page from a server, you always get the same html file.
In contrast, some websites are dynamic.
When you visit Amazon, they dynamically build a webpage specific to you.
A dynamic website will rebuild html files for each user using data on their servers.
You can, however, have some interactivity for static websites using JavaScript.
JavaScript is another programming language that can run client-side (on your machine).
We will focus on basic HTML files.
Really, an HTML file is just a messy document.
Every HTML document is made up of a nested list of elements.
A basic element is <p></p> for paragraphs of text.
<p> defines the start of a text paragraph</p> defines the endAn important part of any HTML document is linking to another webpage.
Links can be added with an <a> element.
Notice that this element/tag has an additional argument
href= is an attribute for the <a> element
download= is another possible <a> attribute
If download is set to a filename, then the linked document will be downloaded with that name instead of being opened.
We can use the <div> to set a style attribute for a group of html elements.
CSS stands for “Cascading Style Sheets”.
CSS controls the style of HTML elements.
It can be set in 3 ways:
style= argument for a specific HTML element<style></style> element in the <head> section<link> to an external CSS fileClass styles are set with .classname{}. Classes are set as attributes.
Can be turned on for any repository.
You will need to tell it which “branch” has your HTML files
And whether they are in the “root” folder or “docs/” subfolder
Each GitHub user can setup a home page for their GitHub account.
It is always called:
The URL for my account would be “https://bchaps1999.github.io”
Every repository can have its own page.
By default, these will all live at
When you open a website location, your browser will by default open the file called
So the most basic website you can create has only an “index.html” file, and maybe a “styles.css” file.
Bootstrap is a “framework” of pre-made HTML and CSS (and some JavaScript).
Every browser can show you the HTML and CSS of any page.
Cmd+Option+I)Edit the CSS live: change a color or font size and watch the page update.
classcolor or font-size in the Styles paneWriting HTML by hand gets tedious. Site generators (Quarto, Jekyll, Hugo) turn Markdown into HTML and CSS for you; this course website is built with Quarto.
Your personal website assignment (started in class 3/24, due 3/26) will be built with an AI agent.
<head> and <body>, the links, the classes, and the stylesheet?