Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Floating columns

From: Preparing CMS Web Graphics and Layouts Using Open Source Tools

Video: Floating columns

Now that we have got our content and our images in place in this document, it's time to get the content area itself in shape. We said we wanted a left column and a right column, and right now we have graphic, which is the commitment to the environment graphic which is going all the way across the page, and underneath of that is our other content. So we need to get these floated side-by-side. So let's start by editing the left column. This is of course a CSS problem, so we are going to click on our CSS icon and we are going to go to the left ID and we are going to go to Box.

Floating columns

Now that we have got our content and our images in place in this document, it's time to get the content area itself in shape. We said we wanted a left column and a right column, and right now we have graphic, which is the commitment to the environment graphic which is going all the way across the page, and underneath of that is our other content. So we need to get these floated side-by-side. So let's start by editing the left column. This is of course a CSS problem, so we are going to click on our CSS icon and we are going to go to the left ID and we are going to go to Box.

We will set the width of our box to 173 pixels. That's because that's the width of the graphic that we have inside of the left column. See how the red lines have just tightened up right around that graphic? We are going to assign some padding to the left side as well. We will put 20 pixels of padding at the top and we will put 20 pixels of padding on the left, so that our graphic doesn't run right up against the edge of the page. Finally we are going to float this to left by going to Float and choosing Left.

What a Float does is it takes the div that was in place before and it pulls it out of what's called the normal flow of the document. That means that it floats in place and the rest of the document that is within the normal flow flows around the floated element. That's what you see going on here. You can see our content flows around our column just like this. Now there is nothing wrong with what we have done here. We could certainly leave it like this.

We would probably want to put a little padding in between the graphic and the text and there is nothing wrong with going with a design like this. But what our graphic designer specified was actually something that looks like a left column and a right column. So we are going to need to do a little bit more work here so that our text doesn't wrap around that left column. That in fact they are separate. So I am going to come back to the content div and for the content div I am going to give it a width as well. We will make it 660 pixels, and I am going to set the background color to whitish, which is f8f8f8.

I am going to give it some padding. Let's put 20 pixels of on all sides, and finally I am going to float this to the right. So you see now that we have our left column and our right column. Notice too something is going on in the back here. That's actually our footer that is showing up behind the content area here. Probably not what we really intended. We really wanted the footer to be at the bottom, but again since we have pulled our left column and our content out of the normal flow, the rest of the document is tightening up behind it.

What we need to do with our footer is tell it to clear so that it will fall in after the floated elements. So we are now going to go to footer and we are going to tell it to clear both. That will move our footer back down to the bottom of the page and I am going to say OK, so that I can scroll down and show you we now have a footer at the bottom of the page. And see how nicely that's all cleaned up, which is really terrific. The next thing we want to do is style the content where we have the headings and the links to clean that up and make that look a little bit better than the default look and we have right now.

Show transcript

This video is part of

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

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.


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.

Join now "Already a member? Log in

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 Preparing CMS Web Graphics and Layouts Using Open Source Tools.

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


OK
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
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.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

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
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.