Join James Williamson for an in-depth discussion in this video Basic selector types, part of CSS Fundamentals.
- View Offline
- Now that we know a little bit more about CSS syntax,…I want to take a moment to focus on selectors…in a bit more detail.…Remember, selectors allow us to tell the browser…which elements on the page we want to style.…In some cases, you're going to want to apply styles broadly,…to a number of elements all across your site.…In other situations, you're going to want to target…a smaller number of elements, or even a single element.…Understanding how selectors work…will allow you to do just that.…The first selector I want to start with…is the most basic: the Element Selector.…
Element Selectors are global in nature,…meaning, they're going to affect every element…of that type in a styled document.…You simply need to know what the tag is…for a given element in order to style it.…Now, unlike HTML, we don't need the angle brackets…around the tag name, just the tag itself.…For example, to style paragraphs, you'll use the p,…for heading1s, you'd use an h1,…for unordered list, you'd use an ul and so on.…While these selectors are very efficient,…
CSS Fundamentals covers the basic concepts, terminology, and techniques you need to read and write CSS. It's for people who want a big-picture overview before taking hands-on courses. Author James Williamson explains how CSS affects text, borders, backgrounds, and images; how CSS works with HTML; and how the W3C's evolving CSS specification impacts designers. He also reviews some of the most popular CSS editors and frameworks and lists online tools and resources for further study.
- What is CSS?
- Basic selector types
- Using CSS with HTML
- How browsers render CSS differently
- Exploring CSS specifications
- Checking browser support
- Working with fonts
- Understanding the box model
- Adjusting margins and padding
- Positioning elements
- Basic CSS layout concepts
- Media types and media queries
- Working with CSS frameworks and CSS grids