Hi, Today I am going to run through a more complex Div and CSS layout, I will provide you with all the code required at the beginning of the post and then summarize it for you.
This layout will include:
– Top Header
– Vertical Navigation Bar
– Left Side Bar
– Content Area
This will allow you create a template extremely quickly and effectively, also I will run through a couple of tricks to change the layout extremely quickly.
Okay here is the complete code with no external style sheet or images.
Now lets break the code down and look at how everything works. First of we have our basic html tags like the head, body and title tags. We also have whats known as an embedded style sheet, between the tags.
We start off by first laying out the DIV tags, nested between each other where necessary. For example the wrapper DIVs contain all of the other DIVs to keep them in position. We assign ids to our DIV tags so now we can reference them in the embedded stylesheet.
The stylesheet will reference each tag and set a height and width except for the DIVs which will need to expand once content is inserted, for example the content DIV. If you copy and paste the code into a notepad file and save it as index.htm you will now see exactly what layout this gives us, if you have any more questions regarding this layout/tutorial then please leave a comment below.
– If you switch the #sidebar css property, float: left to float: right, this will allow you to have a right sidebar.
– If you take the header div tag and switch it below the navigation tag you can have a top navigation, or you can copy and past the navigation above the header to have a dual navigation.
Good luck with your adventure in web design or development and remember to keep trying things and edit your website to keep up with the latest trends.