Basics of Web Dev + Hosting on Github Pages - Day 0/?
Tags: webdev, beginners, htmlcssjs
Published: 2024-06-21 21:07:03

This would be a very rough draft or more like pointed-down stuff of whatever I will be learning. I have been a web developer for the last 3 years, but I still feel like I am lagging in some areas. 

So the plan is to read the entire MDN [Guides Section](https://developer.mozilla.org/en-US/docs/Learn), blog every day whatever I learn by remembering and jotting it down and keep updating the blog and a GitHub repo.


## Day 0: Web Development

I am currently reading MDN Docs and starting from the basics.

- `npx http-server /path/to/project -o -p 9999`
This caught my attention as to how easy it is to host a project locally
- Interesting that the google search engine treats `-` as a word separator but doesn't do the same for `_`. So use `-` for file names and other variables
1 Anatomy of an HTML Element:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yiz0k6z9smoftsz9z8ur.png)
1. [Quirk modes](https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode). Something that I had not heard before.
- Comments in HTMl are between `<-- {content} -->`
- Don't use heading elements to make text bigger or bold, because they are used for **accessibility** and other reasons such as **SEO**. Try to create a meaningful sequence of headings on your pages, **without skipping levels**.
- Anatomy of CSS ruleset:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jo66lp3y5s3oq75uus0w.png)
- Understanding of [different selectors](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/CSS_basics#different_types_of_selectors) becomes very useful while using JS and JQuery
- Anything in CSS between /* and */ is a CSS comment.
- CSS layout:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr32ig63228ob6r92io3.png)
- `margin: 0 auto;` When you set two values on a property like margin or padding, the first value affects the element's top and bottom side (setting it to 0 in this case); the second value affects the left and right side.
- `text-shadow` [details](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/CSS_basics#positioning_and_styling_the_main_page_title)
- JavaScript was invented by Brendan Eich. JS is a powerful programming language that can add interactivity to a website.  It can be used to create games, animated 2D and 3D graphics, comprehensive database-driven apps, and much more!
- `<script>` tag which loads the file, should be put just before closing of the `<body>`, because:
 - **Performance**: Placing `<script>` tags at the bottom of the HTML document ensures that the HTML and CSS content of the page is loaded and rendered first. This can improve the perceived loading time of the page because users see the content before the JavaScript is loaded and executed.
  - **DOM Readiness**: When a script is loaded at the bottom of the page, it ensures that the DOM (Document Object Model) is fully constructed before the script runs. This is important for scripts that need to manipulate or interact with elements on the page, as it ensures that all elements are available to the script.
  - **Dependency Resolution**: If your script depends on any libraries or other scripts, placing it at the end ensures that any dependencies loaded in the same manner are available by the time your script runs.
 - The reason the instructions (above) place the `<script>` element near the bottom of the HTML file is that the browser reads code in the order it appears in the file. If the JavaScript loads first and it i's supposed to affect the HTML that hasn't loaded yet, there could be problems. Placing JavaScript near the bottom of an HTML page is one way to accommodate this dependency.

- Object can be anything. Everything in JavaScript is an object and can be stored in a variable. Keep this in mind as you learn.


I was getting my hands also dirty by making the webpage they were asking me to make.


NOTE: Completed from [Getting started with web](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web) till [Publishing the website](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/Publishing_your_website)

Here is the link to the repo and the hosted link:
**Github**: https://github.com/theshakeabhi/basics-of-web/tree/main/day-0/test-site
**Hosted Link**: https://theshakeabhi.github.io/basics-of-web/