160 likes | 293 Views
CM143 Web. Week 5 CSS DIV Layouts. <div>. A div(ision) is a section of a page which is treated and styled as a unit E.g. The header, the navigation bar, the footer <div> tags can be used to break up the page into sections which can then be styled and positioned
E N D
CM143 Web Week 5 CSS DIV Layouts
<div> • A div(ision) is a section of a page which is treated and styled as a unit • E.g. The header, the navigation bar, the footer • <div> tags can be used to break up the page into sections which can then be styled and positioned • <div> positioning for layout is the basis of modern web design
Positioning an element • Page elements, such as a <div>, can be positioned in several ways: • Absolute – a fixed distance from the top left corner of the browser window • Relative – a fixed distance from where it would normally appear • Neither of these methods are recommended for a full page layout as they lack flexibility – however they may be useful in specific circumstances
Container Positioning • Most good web layout uses divs positioned with regard to one another inside a container, using the following css properties • Margin • Padding • Float • Clear Let’s look at these individually...