Saturday, December 18, 2021

Austin Coding Academy - Day 6

How is Javascript different from CSS? How are they similar?

In Javascript, there are “collections” of data know as objects. In CSS, there are similar collections of different properties known as CSS rules. These two types of collections are structured very similarly, as well as both can store an indefinite amount of multiple different data types. CSS rules, however, also have characteristics that are more similar to Javascript functions than objects. CSS rules have changeable properties which alter the style and layout of the website, while Javascript objects are essentially just lists of data that can be stored and accessed.

CSS rules are limited to manipulating the styling and design of a website, but Javascript functions are what make the website come ALIVE! Functions are the mathematically based commands that add functionality (pun definitely intended) to our site, such as storing form data, doing calculations, animation and much more. Think of Javascript as the internal mechanical parts of a car that make the car run. HTML is like the structural frame of the car and CSS is like the outer body of the car with a fresh coat of paint plus a new set of rims!

Here's a good video that quickly demonstrates some ways Javascript and CSS interact with eachother

No comments:

Post a Comment