How to Set Properties with Cascading Style Sheets (CSS)


show more Setting properties provides you with in-depth training on Web. Taught by James Williamson as part of the CSS: Core Concepts show less
please wait ...

Setting properties

Writing a selector is really only half of properly writing a CSS rule. Once you've targeted an element on the page with a selector, you then need to define the property or properties that you wish to set to control the style of that element. So let's experiment with setting a few properties for our page element. So I'm going to go over in our exercise files to the 01_05 folder and I'm going to open up properties.htm. So again, really basic page here. We can see that I have some placeholder rules, already written some selectors there h1, h2, p, div, and if I look at the structure of the page, it's exactly what we had last time.

Same structure: the heading one followed by a paragraph, then we have a div with a heading two inside of that, and a paragraph inside of that as well. Okay, so I'm going to go back up to these embedded rules that we have here, and I'm just going to add some properties to the existing selectors. Now CSS doesn't care whether you do i...

Setting properties
Video duration: 8m 40s 8h 52m Beginner

Viewers:

Setting properties provides you with in-depth training on Web. Taught by James Williamson as part of the CSS: Core Concepts

Subject:
Web
Software:
CSS
Author:
please wait ...