Weekly Code Quickies podkast

Ultimate CSS Crash Course: Mastering Cascading Style Sheets

0:00
42:09
Do tyłu o 15 sekund
Do przodu o 15 sekund

Unlock the secrets of CSS and elevate your web development skills with our Ultimate CSS Crash Course. From basics to advanced techniques, learn how to style your web pages effectively in this comprehensive guide.

------------------------------------------------------------------------------------------------- 🕐 Timestamps:

00:00 - Intro & Project overview

01:10 - What will you learn in this crash course

02:03 - What is CSS

02:58 - How to add CSS to HTML

04:01 - How to create a HTML file

04:58 - What is the Style property in HTML

05:42 - How to write CSS in HTML

06:59 - How to create a CSS file

07:26 - How to link CSS files to HTML

08:13 - How to style HTML tags

09:59 - How to create comments in CSS

10:35 - Ho to style Classes in CSS

12:59 - How to style html ID in CSS

14:13 - Most Important properties in CSS

14:34 - How use colors in CSS

16:00 - How to style background colors in CSS

16:17 - How to style the font size in CSS

17:35 - How to style the font family in CSS

18:02 - How to style the Width and Hight in CSS

19:06 - How to style margin in CSS

21:16 - How to style borders in CSS

22:01 - How to style padding in CSS

22:56 - What is the Box model in CSS

25:03 - Excessing with CSS

6:50 - How to style link tags in CSS

28:12 - What are Pseudo classes in CSS

28:46 - What are Pseudo elements in CSS

30:35 - How to select element within element in CSS

31:22 - What is Specificity in CSS 34:03 - What is Flexbox in CSS

34:42 - How to use Flexbox in CSS

36:03 - How to display flex direction column and row in CSS

36:53 - How to add gap in flexbox CSS

37:45 - What is the grid system in CSS

38:16 - How to display grid in CSS

39:06 - What is inheritances in CSS

39:47 - How to use grid template columns in CSS

Welcome to the Ultimate CSS Crash Course! In this comprehensive guide, we'll cover everything you need to know to get started with CSS (Cascading Style Sheets). Whether you're a complete beginner or looking to refresh your skills, this guide is for you. Follow along as we dive into the core concepts, syntax, and best practices of CSS to style your web pages effectively.

Step 1: Setting Up Your Project

Before we begin, ensure you have a project folder set up on your desktop. Within this folder, create two subfolders: html_crash_course and css_crash_course. Open Visual Studio Code (VS Code) and drag your project folder into it. Create an index.html file within the css_crash_course folder.

Step 2: Understanding CSS Basics

CSS stands for Cascading Style Sheets. It controls the visual presentation of HTML content. Think of HTML as the structure of a web page, while CSS is the paint and decorations that make it come alive.

Step 3: Adding Inline CSS

In your index.html file, add an

tag with the content "CSS Crash Course." Use inline CSS to style it. For example:

html

CSS Crash Course

This will set the color to red and the font size to 50 pixels.

Step 4: External CSS Stylesheet

Instead of using inline CSS, we recommend using an external stylesheet for better organization. Create a new file called style.css in the css_crash_course folder. Link this CSS file to your HTML file by adding the following line in the section:

html

Step 5: Writing CSS in the External Stylesheet

In your style.css file, you can now define styles for your HTML elements. For example:

css

h1 { color: blue; font-size: 50px; }

Step 6: CSS Selectors and Properties

CSS selectors help you target specific HTML elements. You can use element selectors, class selectors, and ID selectors. For example:

css

/* Element selector */ h1 { color: blue; } /* Class selector */ .highlight { background-color: yellow; border: 2px solid orange; } /* ID selector */ #main-content { width: 80%; }

Step 7: The Box Model

Understanding the box model is crucial for controlling the layout of your web page. The box model consists of content, padding, border, and margin. For example:

css

#box { width: 300px; height: 300px; padding: 20px; border: 5px solid gray; margin: 10px; }

Step 8: Flexbox and Grid Layouts

Flexbox and Grid are powerful layout systems in CSS. Flexbox helps you create flexible layouts, while Grid allows you to design complex grid-based layouts.

Flexbox Example:

css

.container { display: flex; flex-direction: row; gap: 10px; }

Grid Example:

css

.grid-container { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

Step 9: Adding Pseudo-classes and Pseudo-elements

Pseudo-classes and pseudo-elements allow you to style elements based on their state or position. For example:

css

/* Pseudo-class */ a:hover { color: #666; text-decoration: underline; } /* Pseudo-element */ a::after { content: " (visited)"; font-size: small; }

Conclusion

Congratulations! You've completed the Ultimate CSS Crash Course. By following these steps, you now have a solid understanding of CSS and how to style your web pages effectively. Keep practicing and exploring more advanced CSS concepts to become a proficient web developer.

Happy coding,

Norbert B.M



Get full access to Norbert’s Web Dev School at norbertbmwebdev.substack.com/subscribe

Więcej odcinków z kanału "Weekly Code Quickies"