Join James Williamson for an in-depth discussion in this video Borders, part of CSS Fundamentals.
- View Offline
- [Voiceover] Borders define the outside edge of elements,…and are usually used to apply…a decorative effect to specific elements.…Element borders are usually defined by three properties.…Style, width, and color.…Much like margins and padding, borders can be defined…for the top, right, bottom, and left sides individually,…or defined for the entire element at the same time.…A border SYNTAX can sometimes be quite verbose…as you specify width, style, and color…for each individual side.…
Now because of this authors typically use…border shorthand notation that allows you to set…all three border properties at the same time.…The important thing to remember about borders,…is that they do affect the overall width of an element.…Border widths begin at the edge…of padding widths, and then extend outward.…It's easy to forget about a one pixel border on an element,…but this is often the culprit for breaking layouts…or causing elements to shift unexpectedly,…so when authoring CSS, be sure to account…for border widths when planning layouts.…
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