How Do Websites Actually Work ?

·

3 min read

What exactly does HTML, CSS and JavaScript do exactly

in order to access a webpage, we all know that you need a browser, right? And that can be Chrome, Safari, Firefox, whatever is your favorite one.

image.png

These are all pieces of software that allow you to look up the IP address of your website and be able to receive data that it can render into this beautiful websites that we see.

The data that you receive from the server

usually consists of three types of files ;

HTML, CSS, and JavaScript.

image.png

what exactly do they do ,why are there so many different types of files ? , Why can't we just have one file that's, you know, a website ?

they actually have very different jobs.

image.png

HTML

The HTML code file is responsible for the structure of your website.

So if a website was a house, then the HTML would be the builder who would come in to build the walls or put in a toilet. Basically they establish the structure of your house. And when you write HTML code, you also build up the structure of your website. So you could use HTML to add an image or button or text box, whatever it is that you need in your website.

CSS

are responsible for styling your website.

If you were building a house, then this would be the painters and decorators. They would be going around painting the walls or adding stylistic flourishes to your place, and generally making the place look the way that you want it to. And that's exactly what CSS code does as well. When you incorporate CSS, it allows you to specify how you want your website to look. So you could say that, yes, I have a button that I got from my HTML, but that button I want it to be red and I want the text to be white and I want the font of the text to be an Arial. That is all done using CSS code.

JavaScript

this is the code that allows your website to actually do things or have behavior. And if you were building a house, you would have the electrician come in, who would be able to connect the wires so that your light bulbs actually switch on or somebody who comes in and does the plumbing so that your toilet can actually flush. And the JavaScript code does exactly that. It allows your website to actually do things and have behavior.

image.png

Receive HTML File image.png

Receive CSS File

image.png

image.png

Receive JavaScript File

image.png

image.png