From the course: Creating a Responsive Web Design

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Defining the basic text styles

Defining the basic text styles - CSS Tutorial

From the course: Creating a Responsive Web Design

Defining the basic text styles

- So now we'll add some CSS rules for the base text styles. So hit a few returns after the body element. Now I like to add some CSS comments into my CSS just so I can quickly see where groups of rules are. So that would be a /* space. We'll just call this Text. And then */. Same thing I did up here for the Document for Screens. Let's hit a few returns. So first let's target our h1 tag. So I'll type h1 { } bracket. Inside of here we're going to set a margin. Now for the properties I'm going to use shorthand style which goes in the order of a clock. So the first one is top, right is second, bottom is third, and left is fourth. So for the top property I'll type 0, then a space. For the right property we'll type 0, then a space. Then for the amount of space after an h1 tag we're going to use 1em. Now by specifying 1em we're basically saying one times the base font. So this will be approximately 16 pixels. Now I say approximately because by defining ems we're giving the devices a little…

Contents