Introduction to Web Development: HTML + CSS + Javascript
Tags: webdev, beginners, javascript, html
Published: 2022-07-01 20:37:52

Hey babes! The easiest way to start programming is perhaps with web design. Well, maybe not but it’s the easiest to follow without hitting some sort of learner plateau.

Let’s start by saying two truths and one lie:

1. HTML is short for HyperText Markup Language and with it we write the content of our page
2. CSS (Cascading Style Sheets) are used to make the design of our page
3. Javascript comes from java is the script or where the programming happens of our page
Well it’s half a lie. Javascript doesn’t come from Java but it started on the idea of the old Java applets that were used before in browsers. The half truth comes from the fact that Javascript is the only one from these three in which you actually code.

At the end I will write some courses, pages and videos you can look for so you can actually immerse yourself in this. 
What you will need:

- A code editor
- Browser

For code editor I recommend using Visual Studio Code for the extensions you can add.

## HTML:


![Simple html](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oced2839tgi4ole1d2k8.png)

Most tags open and close in html. This is the basic template of how a html doc looks like.

Create a file named index.html, if you are using Visual Studio Code you can use the Emmet Abbreviation ! to create it.

Let’s add a Heading 1 tag `<h1></h1>` to be able to see the css.

![h1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xxhfzi8a7q27to7a5kzw.png)

Let’s open it. You can open your html by clicking in Your Files and opening it with a browser or with a server. Visual Studio Code has an extension called Live Server by Ritwick Dey that you can use to open it.
To be able to see the changes you might have to save and refresh your page in the browser. But you will have this page:


![page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9aw0sasda9lzg1fhkgw.png)


## CSS

Now let’s add a simple design.


![css](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0jj8gnh8gohox11543b0.png)

You can use tags like body, classes (.[name_of_your_class]), ids (#[name_of_your_id]), and general selectors like * to call what you want to style. Then you open and close curly brackets {} with the style you want to give them.

For your page to use the style, you have to connect them with `<link/>`. Link is a self-closing HTML tag.


![css link](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aum28yjqugkw2xevp5ls.png)

The code above will look like this in your browser.



![page with css](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v7ph5zhuuumoskkv68v3.png)


## Javascript

![js](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6pzvkvd9d5gjjmpvb1a.png)



In javascript you will code. Clicks, hovers, and keys you click are events that work on top of the document. You can select the part of the document you want (element) by getElementBy[...]. In this case we will only add an event to the whole document that will be triggered when you click any part of the page. We create a new element that has the phrase Welcome! And then we append it (add it to the end) of our body in html.

We then add it to our html with the tag <script></script>. This will go either before the ending of the body tag or in the head with a defer option. 


![js in html](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/httksmteha9x9jlgzyai.png)


When you click your page it will add the new text.


![page with js](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1lov871p0gvtrazvy0dv.png)

Now you have your first page! It’s easy if you go step by step and understand why everything happens!


## Resources to learn more
[https://www.freecodecamp.org/learn/](https://www.freecodecamp.org/learn/) - Responsive Web Design for html + css
[https://learnjavascript.online/](https://learnjavascript.online/) - Interactive learning for javascript
[https://mikkegoes.com/javascript-projects-for-beginners/](https://mikkegoes.com/javascript-projects-for-beginners/) - Do projects instead of learning javascript theory
[https://www.w3schools.com/html/default.asp](https://www.w3schools.com/html/default.asp) - HTML documentation
[https://www.w3schools.com/css/default.asp](https://www.w3schools.com/css/default.asp) - CSS documentation
[https://developer.mozilla.org/en-US/docs/Web/JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) - Javascript Documentation
[https://javascript.info/](https://javascript.info/) -  Javascript Documentation