Foundation class for 100xdevs cohort
What we're learning
1. VSCode
2. HTML
3. CSS
4. JS
5. DOM
6. Assignments
Small boi stuff
1. Tags
2. Attributes
3. Inline styles (bg color, fonts ...)
4. JS Basics, data types, loops, fns...
Big boi stuff
1. External styles, classes and ids
2. Flexbox
3. Connecting JS to HTML
(selectors, DOM)
4. Chrome Dev tools
What we'll learn practically
What we're building
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10920826/Screenshot_2023-11-15_at_5.09.31_AM.jpg)
Stage 1
(HTML Only)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10924049/Screenshot_2023-11-16_at_6.57.56_AM.jpg)
Stage 2
(HTML + CSS)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10924110/Screenshot_2023-11-16_at_7.32.51_AM.jpg)
Stage 3
JS
Create a portfolio returns calculator
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10930984/Screenshot_2023-11-19_at_4.43.33_AM.jpg)
Before we start
What are browsers? How do they render websites?
What purpose do HTML/CSS/JS serve
How much of this do we actually use in the industry -
1. html => very minimal
2. css => minimal
3. js - heavy
IDE
VSCode
Vim
WebStorm
HTML
Defines the structure of your website
2 jargon we need to know of -
1. Tags
2. Attributes
HTML Tags
- <html>
- <head>
- <title>
- <body>
- <div> / <span>
- <h1> .. <h6>
- <p>
- <img>
- <a>
- input
- <button>
- <b> / <i>
- <center>
Attributes
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10930983/Screenshot_2023-11-19_at_4.22.51_AM.jpg)
- <input id="username">
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10930987/Screenshot_2023-11-19_at_4.46.59_AM.jpg)
Css
They let you add styles to your website (colors, font sizes, background colors ...)
Used for positioning things on the page
How to add styles?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10931002/Screenshot_2023-11-19_at_4.56.13_AM.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10931003/Screenshot_2023-11-19_at_4.56.09_AM.jpg)
How to add styles?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10930996/Screenshot_2023-11-19_at_4.53.51_AM.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10930999/Screenshot_2023-11-19_at_4.55.05_AM.jpg)
Common styling attributes
color
background
border-radius
border
padding / margin
box-shadow
How to position?
divs always take up all the space available horizontally
spans only take up as much space as needed
Can you make divs take only the space they need?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10931014/Screenshot_2023-11-19_at_5.00.16_AM.jpg)
Title Text
How to position?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10931012/Screenshot_2023-11-19_at_5.03.13_AM.jpg)
Dumb way
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10931012/Screenshot_2023-11-19_at_5.03.13_AM.jpg)
float property
Flex box
Right way
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10931016/Screenshot_2023-11-19_at_5.07.24_AM.jpg)
display: flex
on parent
makes all div siblings reside
in the same line
Flex box
Javascript
It is a scripting language
It can be used to solve algorithmic problems/do ML/do backend development
Specifically for websites, it is useful to add functionality to your website (for example, a returns calculator)
We're going to practise on repl.it first
For JS (or any language), you need to know
- variables
- Simple Data types (strings, numbers, boolean)
- Complex Data types (arrays and objects)
- Control statements and operators
- Loops
- Functions
Problems to understand these
1. Count from 1 to 1000
2. Is Palindrome?
3. Find the name of the oldest person in a group
Take home assignment -
Find the age of k oldest people in the group
https://leetcode.com/problem-list/top-interview-questions/?topicSlugs=string&page=1&difficulty=EASY
https://leetcode.com/problem-list/top-interview-questions/?topicSlugs=array&page=1&difficulty=EASY
Connecting JS to returns tracking app
First let's write a function that takes 3 inputs
1. numberOfYears
2. base
3. yearlyGains
and returns net portfolio value
Assignment
![](https://s3.amazonaws.com/media-p.slid.es/uploads/2476268/images/10935135/Screenshot_2023-11-21_at_2.13.08_AM.jpg)
deck
By Harkirat Singh
deck
- 9,116