There are three languages that all web browsers understand:
- HTML (HyperText Markup Language) -- the skeleton, the structure of the page.
- CSS (Cascading Style Sheets) -- the skin (or hair and makeup), the presentation of the page.
- JavaScript (or JS for short) -- the brain and nervous system that makes decisions, responds to the user, etc.
⭐ The bare minimum you need to create a web page is just an HTML file! CSS and JavaScript are entirely optional!
The three languages are saved as three corresponding file types: a .html
file, a .css
file, and a .js
file.
The most common file names, which we'll use today, are:
index.html
,style.css
, andscript.js
-- just a convention, not a hard rule.
This is all you need to know about HTML for today's class:
Beyond that, HTML is a relatively easy language to learn, since its only purpose is to label parts of your web page: "this is a paragraph, this is the title, this is an image, and they go in this order."
Note: There are tons of free online resources to learn HTML! In just a few hours, you'll be able to make your own basic web pages with HTML. For today's class, any HTML for our pages will be provided and you'll
Every time you visit a web page, your computer downloads all the files for that page! Most web pages use all the three native web languages: HTML, CSS, and JavaScript, so most web pages download at least those three files.
When you visit a page, your computer first downloads the HTML file. Then it reads that file line by line, from top to bottom, and the HTML file specifies which other files to download:
The red text and arrow highlights how the HTML file tells the web browser to also download the script.js
file -- and now the JavaScript code in script.js
can communicate with the HTML code in index.html
!
If you look closely in the image above, you'll also see how the HTML file links the
style.css
so that the HTML can talk to the CSS too. (And by extension, this also lets our JavaScript talk to the CSS if we want it to!)