A Two Column Layout Using HTML5 and CSS
For the two-column layout, there is a HTML page and a CSS script already created for you. The HTML page is in the extra_files/layouts folder that came with this course, and the CSS script is in the extra_files/css folder (two_col_style.css).
(If you haven't got the extra files yet, the download location is here, under the heading Web Design - New Course Open up the HTML page first and take a look at the code. The page is calledlayout_two_col.html, and the code looks like this:
When the page is viewed in a browser, it looks like this:
The second column is for the main contents of the page. Here, we have two articles. Again, the background colours are just so that you can see each section.
Open up the two_col_style CSS file and take a look at the code. Compare it to the one column layout. Again, there's not that much difference.
The part that moves the navigation bar to the first column is the float: left in the NAV class, and the display: block in the NAV list class. You then play around with the widths and height to get the look you want.
Exercise
Play around with the various CSS values and see what happens when you reload the page. For this exercise, it's better to copy our file into your own HTML folders, that way you'll leave the original untouched.
Exercise
Research navigation bars on the internet. You can start with this page:
Friday, 10 July 2015
A Two Column Layout Using HTML5 and CSS
http://www.maxdesign.com.au/articles/css-layouts/
It is a bit old, now, but still gives you a good idea of what CSS layouts are all about.
0 comments:
Post a Comment