Viewers: in countries Watching now:
CSS: Page Layouts introduces basic layout concepts, gives advice on how to create properly structured HTML based on prototypes and mockups, and goes into critical page layout skills such as floats and positioning. Author James Williamson shows how to combine these techniques to create fixed, fluid, and responsive layouts. Designers are also shown how to enhance their pages through the creative use of CSS techniques like multi-column text, opacity, and the background property. Exercise files are included with this course.
Okay, it is lab time. Now, for the flexible layouts lab, I'm not going to make you go through the whole planning process for the desolve.org site. That would be just cruel. Rather, I am going to give you the appropriate values for the main sections, and then let you go through the layout to determine which elements to style, to achieve the desired width and spacing. You might think I am being nice to you there, but probably not. Now you'll also be determining an appropriate overall size range for the layout. You are going to be styling some interior elements and you are going to be on your own there.
And then you are going to be fixing an issue with some of the images on the homepage as well. So to starting working on a lab, go into the 06_06 directory, and open up index.htm and the main.css file, which is found in the _css folder of the 06_06. Okay. Now, I just want to go into the browser really quickly. I am going to preview where you are going to start versus where you are going to finish. So this is the starting layout. You can see our columns aren't working properly. We don't even have spacing going on there.
It does flex, but it's not exactly what we think of, when we think of a flexible layout. Now this finished version, after you are done with it, it's going to look like this. We are going to be able flex the layout, but you need to set a defined range for it, so at a certain point layout is going to stop flexing and we are also going to have to deal with these two elements right here. You are going to have to come up with the appropriate measurements to get them to space properly and still flex, and then for these images in the sidebar, you are going to have make those flexible as well, but you want them to be able to display it at a native resolution if they can.
So if I go back into the styles, you can see that the main.css that I have given you all of your labs steps, but right here some information you are going to need. You have got Left document padding, you have got the Main column Width for the left column, you got the Right column Width for the right column and you have the Right document padding on that side. So, here are steps. The first thing you are going to do is go to your Basic Layout styles at about line 156. You are going to set the body width to 90% and then find an appropriate range for minimum and maximum page width, so that's going to be left up to your own discretion, and it's going to be based on number of factors, but remember, you can take some screenshots, you can take measurements of the screening, and you can kind of figure out where the layout fails once you get everything set up and help plan you range from there, so, that's actually something in terms of the minimum and maximum page width, that you might want to do once everything else is finished, so you can really determine where you still have problems within the layout.
And using the values that we have right up here, you again, want to go down into the Basic Layout styles, find the selectors for the article, in the aside selectors, find those and then set the appropriate width and padding values for both of those elements. After you are done with that, go into the Content Region styles, which you can find on about line 184. Now you are going to have to go and find the selectors that control the header, main navigation and banner regions, and then you are going to determine what property you need to modify and what value you need to set, so that it's content lines up with the rest of the page content.
For the two news selectors which are on line 347, those are the two that are side by side, you need to determine an appropriate width padding and margin to get those elements to display side-by- side within acceptable amount of padding and spacing between the elements. Now there is a lot of judgment call that's going be going on there. So your values might not match with my finished values, and that's okay. So as long as you are comfortable with the spacing of it, that's fine. Now for the contest image selector which is found on line 635 in the css, you are going to need to add a property that allows the images to display at their normal size if that's available, and then still scaling it, if the screen size is reduced.
Now, I said, you may, but that's a big hand that you are going to have to. You are going to have to go in and modify the image tags directly in the index.htm file as well. So if you go into the code and you scroll down, you are going to go into the aside and you are going to find those images right here, so about line 182 and line 77, okay. So I'm betting to that, it's probably enough to keep you guys busy for a while. Now for this lab, you may need to go back to some of the previous movies and refresh your memory about a few of the techniques that we covered. That's fine.
You'll also need to make a few educated guesses and probably employ a little trial and error on a few of the elements. And to be honest, I did that to you on purpose. Now usually when you're working with fluid layouts, especially really complex ones, your initial planning works fine up to a point. Then there are always places within the layout that you are just going to have to test and tweak in order to get the layout looking the way you wanted to. And don't forget, once you've finished to watching the solutions movie that follows this one, to compare your code to mine, and hear my take on how I solved some of these problems.
There are currently no FAQs about CSS: Page Layouts.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.