1 / 16

CM143 Web

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

diane
Download Presentation

CM143 Web

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CM143 Web Week 5 CSS DIV Layouts

  2. <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

  3. 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

  4. 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...

  5. <div> in container

  6. Changing the width

  7. Margin

  8. Margin & Padding

  9. Basic 4 <div> layout

  10. Create <div> sections

  11. Change width and float left

  12. Problem: flow around a float

  13. Left margin on content <div>

  14. Problem: Float overflow

  15. Clear:both on footer

  16. Styled 4 div layout

More Related