Giter Club home page Giter Club logo

inspecting-the-dom's Introduction

Inspecting The DOM

"Inspecting the DOM with your browser's Developer Tools" is a sentence with quite a few new words. But have no fear, this repo makes it clear!

This repository containes a collection of live web pages designed to help you understand the lifecycle of an HTML web page (HTML+CSS source code -> the DOM -> rendered content) and how you can use your browser's Developer Tools to inspect and modify the DOM.

You'll know you have mastered this repo when you understand (and can explain to someone else!) the 3 stages in an HTML page's life-cycle using your DevTools and any simple website:

  1. HTML & CSS Source Code: This is the text that you write in a .html file and open with your browser. HTML is a mark up language, meaning it describes to a computer how you want the content on your web page to be organized behind the scenes. CSS is a language to describe how your web page should be rendered on the screen. You can't edit the source code from the browser, only from your text editor. Any changes you make in the browser will disappear when you refresh the page.
  2. The DOM Tree: When you open an HTML file in your browser, it parses the code you wrote and builds the DOM Tree. The DOM Tree is very similar to your HTML but will not be exactly the same, <table> tags are helpful for understanding this.
  3. Rendered Content: The DOM is an abstract representation of the content in your website, it is NOT exactly what you see on the screen. This is easiest to understand when you think of CSS: it is possible to write one div below anther in your .html file, have them in that order in the DOM (dev tools), then switch them on screen in the final rendering using CSS. Why is this? Because (aproximately) HTML is used to describe the DOM, and CSS is used to describe how the DOM is rendered. (don't worry if that doesn't make sense right away, it'll take some practice to wrap your head around the idea).

"Great!" you say "This is a very well written explanation. But why does this matter, can't I just make pretty things?". Yes, you could just hack together some HTML & CSS to make pretty pages, but without learning to use the Developer Tools and without understanding the HTML lifecycle (HTML+CSS source code -> the DOM -> rendered content), you'll never leave the minor leagues.

Not only is it very difficult to catch your mistakes in HTML & CSS without mastering the DevTools, but mastering the DevTools before moving on to JavaScript is one of the single most helpful things you can do to prepare.

index


Learning Objectives

  • See the source code for any web page directly from the browser (ctr-u in FireFox)
  • Inspect the DOM using your browser's Developer Tools
  • Modify a live website from your browser's Developer Tools (not the source code!)

TOP


The Exercises

All exercises in this repository consist of an example meant to be studied as in a live web page, how else do expect to practice inspecting webistes!

Here they are:

  1. basic example without CSS
  2. basic example with CSS
  3. rearrange with CSS
  4. tables are not as they appear!
  5. HTMl bugs:
  6. Ways of including CSS:
  7. CSS bugs:

TOP


Study Links

What is the DOM?

visualizing the HTML life-cycle:

HTML -> DOM, CSS -> Rendering:

Dev Tools:

HTML:

CSS:

Looking for more like this?

TOP



Hack Your Future: Belgium

inspecting-the-dom's People

Contributors

colevanderswands avatar jbelien avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.