====== Web Development Lesson 5 - Layout ====== ===== Forced Positioning ===== ==== Objective ==== This activity introduces some predefined HTML tags for structuring pages and looks at using 'position' to force your page into a particular layout. ==== Setup ==== * Create a new file called 'layout.html' in your personal directory. * In 'layout.html', set up the basic HTML code with a link to 'style'css'. ==== Predefined Layout Tags ==== * HTML includes some predefined tags to help you layout your document. Add this code to the of your 'layout.html' file.
Header
Main
* Before we look too hard at these tags, let's add some CSS so you can see what their default layout looks like. Add the following code to your 'style.css' file. header { background-color:indianred; border:darkred solid 2px; } nav { background-color: burlywood; border:yellow solid 2px; } main { background-color: lightgreen; border: darkgreen solid 2px; } footer { background-color: lightskyblue; border: darkblue solid 2px; } * Now open 'layout.html' in Live Server and see how it looks. The colors and borders are purely there for your understanding of how the pieces fit on the screen. Usually they will have similar backgrounds. * All four elements fill the screen from left to right, wrapping their content tightly at left, top and bottom and they are stacked on top of each other in the order we've placed them. * You could use these for any content you like, but of course it's easier for you and anyone you might work with to follow if you use them as named. *
is usually for the banner at the top of the screen showing the site logo and name. *