From the course: CSS Fundamentals: Unlock the Power of Web Styling
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
How does CSS work with HTML? - CSS Tutorial
From the course: CSS Fundamentals: Unlock the Power of Web Styling
How does CSS work with HTML?
- [Instructor] I'd like to take a few minutes to talk about how CSS works with HTML structure. Now remember, that to style elements in your documents, you'll need to write selectors that target those elements. The more efficient and logical your HTML, the easier it is to write efficient CSS. CSS works with the structure of your HTML document, allowing the browser to parse the HTML code, find the right element and style it accordingly. Having well-structured, consistent HTML, and being familiar with that structure, makes it a lot easier to write CSS for it. So let's talk about some best practices that you can follow when writing HTML and how it impacts your CSS. For starters, try to use meaningful names for IDs and classes. What do I mean by that? Well, let's take a look at this in my code editor here. Here, I've got lots of classes and some IDs to define styling for all of these elements. Now, as far as functionality goes,…
Contents
-
-
-
What is CSS?3m 52s
-
(Locked)
What are default browser styles?2m 41s
-
(Locked)
What is basic CSS lexicon?3m 22s
-
(Locked)
What are basic selector types?4m 3s
-
(Locked)
What are CSS combinators?2m 18s
-
(Locked)
How does CSS work with HTML?4m 40s
-
(Locked)
What options are available to write your styles?2m 44s
-
(Locked)
How do browsers render styles?3m 53s
-
-
-
-
-
-