Start learning with our library of video tutorials taught by experts. Get started

Exploring CSS Positioning

Adding CSS rules for the column


From:

Exploring CSS Positioning

with Candyce Mairs

Video: Adding CSS rules for the column

Now that my HTML content has been added for the header region on my page, the menu region on my page, and the left column content, what I want to do is fine-tune this left area here. And add some additional CSS properties for my left column. I'm also going to add some additional CSS style rules for HTML tags within the left column. So ultimately, we're going to be looking at adding some CSS rules for both the div itself, as well as HTML tags within that div.
Expand all | Collapse all
  1. 1m 13s
    1. Welcome
      1m 13s
  2. 33m 20s
    1. Why CSS positioning?
      5m 50s
    2. HTML editors
      3m 18s
    3. Getting set up
      3m 39s
    4. Previewing pages in browsers
      3m 51s
    5. Customizing the HTML editor
      5m 32s
    6. Exploring browser variances
      5m 16s
    7. Browser extensions
      5m 54s
  3. 30m 33s
    1. HTML vs. CSS: Which does what?
      9m 55s
    2. HTML div tags
      4m 57s
    3. CSS properties
      6m 21s
    4. The CSS box model
      9m 20s
  4. 28m 46s
    1. Planning the page layout
      3m 47s
    2. Building the header box
      6m 23s
    3. Positioning with HTML
      3m 36s
    4. Positioning with CSS
      8m 21s
    5. Foreground vs. background content
      6m 39s
  5. 25m 44s
    1. Building the menu box
      5m 7s
    2. Adding the menu links
      4m 58s
    3. Formatting the menu with CSS
      6m 43s
    4. Positioning the menu with CSS
      8m 56s
  6. 21m 42s
    1. Adding the middle column
      6m 29s
    2. Creating a CSS rule for the column
      6m 20s
    3. Adding CSS rules for the column
      8m 53s
  7. 19m 49s
    1. Adding the right column and inserting images
      7m 33s
    2. Completing the right-column content
      4m 18s
    3. Formatting the right column using CSS
      7m 58s
  8. 26m 14s
    1. Understanding the float property
      6m 5s
    2. Applying the floats
      6m 1s
    3. Finishing the floats
      6m 24s
    4. Adding CSS properties to the right column
      7m 44s
  9. 30m 59s
    1. Setting up for background colors
      5m 49s
    2. Adding a footer
      8m 50s
    3. Adding the background colors
      7m 20s
    4. Positioning the footer
      9m 0s
  10. 16m 38s
    1. Comparing the web page to the graphic design
      6m 50s
    2. Adjusting the web page as needed
      4m 25s
    3. Adding the final touches
      5m 23s
  11. 2m 43s
    1. Closing thoughts
      2m 43s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
Exploring CSS Positioning
3h 57m Beginner May 24, 2012

Viewers: in countries Watching now:

CSS enables you to control the look and layout of a web page much more precisely than you could with HTML alone, but it can be time-consuming to learn. In this workshop, expert developer Candyce Mairs makes styling a quick and easy process, walking you through the process of adding content to a web page and using CSS to position that content. Candyce explains CSS positioning concepts like the CSS box model, floats, and clears and demonstrates how HTML and CSS work together to create the look of your web page. By speaking the same language as the browser, you can learn to work with the browser to place content accurately and easily.

Topics include:
  • Previewing pages in browsers
  • Customizing the HTML editor
  • HTML vs. CSS: which does what?
  • Building the header area
  • Adding the navigation menu
  • Positioning using a float
  • Adding background colors and images
  • Comparing the web page to the graphic design
Subjects:
Web Web Design video2brain
Software:
CSS
Author:
Candyce Mairs

Adding CSS rules for the column

Now that my HTML content has been added for the header region on my page, the menu region on my page, and the left column content, what I want to do is fine-tune this left area here. And add some additional CSS properties for my left column. I'm also going to add some additional CSS style rules for HTML tags within the left column. So ultimately, we're going to be looking at adding some CSS rules for both the div itself, as well as HTML tags within that div.

So, let's take a look at it. Right now, this left column, and this is purely my design concept, the left column has a header, and this will become my header on the page. Within that content area, I have two paragraphs under that header that will both be paragraphs. Down below that, I have some additional information here about the different destinations that ScubaBlu provides tours to, and the destinations is a bit of a header, as well. And then I have four different paragraphs of text. So if I go down into my content area for the left, you can see right now it just says, ScubaBlu is a specialist in dive travel.

I do not have a header one that says, dive with ScubaBlu, so I'll go ahead and add that. Within this area, if I go down to code for HTML 5 within CoffeeCup specifically, I have all of my tags. So, I'm going to drag out a header one tag and within this, I'm going to say, dive with ScubaBlu. There we are. Dive with ScubaBlu. And I'll put an exclamation mark there.

So I now have my header one and my p tags. This destinations right now, is inside its own p tag that also includes the Australia area, because you can see, here's my closing p, her's my opening. So what I want to do, is I'm going to take this p and move it down below, so that the Australia line is within the p, and my destinations here is going to get an h2. I'll just type it out this time, since I already have this bracket here. And this break tag or br tag is a break.

And so, it's a way to create a line return. Destinations would go directly above Australia without any space between it. So here is my header two. And let me make sure that it's a closing right there. Now I also have this little issue of the single space, so I'll make sure those two line up. It just makes it cleaner and easier moving forward when you come back to modify. Now that I've created the header one, a p and an h2, I need to go up to my style rules here, because I do not have a selector for those.

So what I'm going to do underneath left. Why am I choosing it here? I tend to place my id rules, which is the rules with the pound sign in front of them, up at the very top within my style rules. I actually find I tend to modify these a lot more than my other rules. So because of that, I place them at the top, just because they're easier to find. So I'll go down here, and underneath those ids, I'll start with my h1 tag.

And my h1 is just a tag, so it does not get a pound sign, then I'll create my rule. Now what should I do with this rule? Well, I think it should probably be the same font-family as the rest of my text. So my font-family, and I can just select this and double-click, is going to be Georgia, or whatever the default Serif font is, if Georgia's not on the system. Under font size, I will make this let's say, 1.4m for a header one. I'll keep it black colored.

By default, it ends up black so I don't need to modify that. And then, I'm going to copy this header one, the entire piece, and I'll paste it down here, just changing it to a header two. Now, my header two, I'll make a fair amount smaller. I'll make it a 1.1m. If I save my page and take a look at it in the browser now, I should have my content set up. And you can see my header one and header two are all set with the Georgia font.

These paragraphs are not however, so I need to add those. And I could just paste the same thing I did for the header one. I still have it on my clipboard. So I can paste it down below here, and just change that to a p tag. And my p tag I think I'll make, let me say, 0.85ms. I'll start there. Now an m represents the width of the letter m and whatever font you're working in.

Here is the Georgia font, and it's the width of that letter m. The default width would be 1.0. This is actually going to end up a little bit smaller than the default size that it was in straight HTML. So let me go look at my page, now. And that looks much better. So there's my font. Now I do have a space between destinations and Australia, which I did not have in my original design.

Anytime you make something a header tag, it adds extra space down below here. And I can modify that. Once I get to a few more of the positioning pieces for this column, I'll go ahead and modify it then. So for now, I'm just getting this information set up. Now there's one piece I haven't mentioned yet, and that is what I've done is created header one, header two, and p tag properties. Now I may not want these properties to apply to every column or every area within my page. In other words, if I use a p tag in the left column, I may want it Georgia, but in the right column, I may want it something else. The way I could specify to only use these properties if it's inside the left column, is to put the left id in front of the tag. So I will put #left.

Space, h1, #left, space, h2. And you can think of that space as representing the word and. So I'll finish this off. What I'm saying is, if it's inside the left id and it's a header one, do this. Same thing here. If it's inside the left id and it's a header two and it's a paragraph. What this does, is limit these properties to only apply within that particular part of the page.

So I'll save this and let's take a look. It should not look really any different to us, now. But what this is going to do, is prevent me from having to come back and modify this once I add my right column of content. It just limits it to this particular box. As long as it's within this box, it's going to look this particular way. So what I did, was use CSS properties to format my text with an only this box on the page.

And that is how you add those CSS properties for within a specific div on your web page.

There are currently no FAQs about Exploring CSS Positioning.

Share a link to this course
Please wait... Please wait...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Exploring CSS Positioning.

Return to your organization's learning portal to continue training, or close this page.


OK

Course retiring soon

Exploring CSS Positioning will be retired from the lynda.com library on April 24, 2014. Training videos and exercise files will no longer be available, but the course will still appear in your course history and certificates of completion. For updated training, check out CSS: Page Layouts in the lynda.com Online Training Library.


Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked