Essential CSS
JavaScript Roadmap
Learn JavaScript
Mastering Web Typography
Practical Astro
Understanding Async JS
Unorthodox Tailwind
API Masterclass
Build and Deploy
The Beginner Freelancer
Real World Node
Profile Billing Logout
Essential CSS
Lesson Plan
  1. Introduction
    1. Welcome to Essential CSS
    2. Getting started with the course
    3. What are file formats?
    4. Web standards
    5. What is HTML?
    6. What is CSS?
    7. Devtools, your indispensable best friend
  2. CSS Key Concepts
    1. Some background about CSS
    2. CSS Syntax and Terminology
    3. Selectors
    4. Cascade and Specificity
    5. Origin and Importance
    6. Inheritance
    7. How browsers handle CSS
  3. Basic Mental Model
    1. Everything on the web is a box
    2. The box model
    3. How big is your box?
    4. The relationship between px and em
    5. The `box-sizing` property
    6. The `display` property
    7. Formatting contexts
    8. Block boxes
    9. Inline boxes
    10. What is inline-block?
  4. Flexbox and Grid
    1. The parent-child relationship
    2. Sizing in Flexbox
    3. Flex directions
    4. Basic grid concepts
    5. Setting up a grid
    6. Placing grid items
    7. Box alignment
  5. Building web layouts
    1. Arranging your boxes on the web
    2. Positioning schemes
    3. Floating boxes
  6. Typography
    1. Making your text look good
    2. What is a font?
    3. Typesetting with CSS

What are file formats?

2m:22s

Have you tried opening a .txt file with your browser before? Your browser is perfectly capable of displaying the content in that .txt file. Browsers can “read” files in a variety of formats (but not all of them though) because files are simply a means for computers to store data.

All digital files are long strings of 0s and 1s AKA binary data. The exact sequence of 0s and 1s is meaningful because that is how computers differentiate one chunk of data from another.

Computers use numerous techniques to determine a file’s format. The most common approach is via the filename extension, which is the made up of a string of letters after the final period of a file. For example, dinosaur.txt has a filename extension of .txt while index.html has a filename extension of .html.

Another approach is via internal metadata. Most files start with information about the file itself in the file header, and computers make use of that information to determine which program is most suitable to open the file.

If you try to open a file format with a program that doesn’t know how to handle it, you will either receive an error message that the file cannot be read, or the content of the file will be displayed incorrectly.

The following are files that contain code in the C programming language and Rust programming language. If you are new to programming, it doesn’t matter if you don’t understand what the code does. But you can see that the code is made up of alphabets, numbers and some symbols.

/* fizzbuzz in c */
#include <stdio.h>
int main()
{
int a;
for(a=1;a<=100;a++)
{
if( a % 3 == 0 )
printf("Fizz");
if( a % 5 == 0 )
printf("Buzz");
if( a%3 && a%5 )
printf("%d",a);
putchar('\n');
}
return(0);
}
/* fizzbuzz in rust */
fn main() {
for n in 1..101 {
if n % 15 == 0 {
println!("fizzbuzz");
} else if n % 3 == 0 {
println!("fizz");
} else if n % 5 == 0 {
println!("buzz");
} else {
println!("{}", n);
}
}
}

The web browser, like you, doesn’t understand what these specific files do either, because the browser doesn’t read C or Rust. But it can also tell the code is made up of alphabets, numbers and some symbols.

So if you try to open these 2 files in your browser, the text in the file will be displayed as is. This is because the browser does not recognise the code in those files as instructions to be run, instead, the browser is treating them as plain text and displaying the code as such.

The file formats that are fundamental to web development are .html, .css and .js. In this course, you will mostly be working with HTML and CSS files.