1 / 7

More divs and Layouts

ITP 104. More divs and Layouts. Some General <div> Layout Tips. Centering: Use a style instruction of "margin: auto" in conjunction with a DEFINED width to make a div/container be "centered" within its area . Some General <div> Layout Tips. Clearing floats:

cade
Download Presentation

More divs and Layouts

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. ITP 104 More divs and Layouts

  2. Some General <div> Layout Tips • Centering: • Use a style instruction of "margin: auto" in conjunction with a DEFINED width to make a div/container be "centered" within its area.

  3. Some General <div> Layout Tips • Clearing floats: • If you are having problems with floating elements overlapping or overrunning elements, stop and think if you need a clear:both to divide up "sections" of your page. • Clear "resets" float settings, which basically means items after a "clear:both" will wait until all current floating elements have finished/closed before the new divs appear/are laid out.

  4. Some General <div> Layout Tips • Building "grid"-like layouts: • If you want to lay out lots of boxes evenly spaced out like a grid, you need to calculate their sizes AND their margins/paddings, then set an outer box that is that total.

  5. Stylesheets • Stylesheets are section of html where you can save one or more style instructions under one "name". • They are located either in the "head" of a page (which is called an internal stylesheet), or in a separate file that is "linked" into a page (which is called an external stylesheet).

  6. Stylesheets • Stylesheets start and stop with "style" tags. • Each "style" in a stylesheet starts with a name • the content of that style is defined by { } brackets.

  7. Stylesheets – Style Types • ID: • In your stylesheet, store your style instructions under an ID (pound sign) name in the format #name ... such as #outercontainer • The object in your page with that id (such as div id="outercontainer") will automatically acquire those style settings • Class: • In your stylesheet, store your style settings under a class (period) name in the format .name ... such as .headline • Any object in the page that is set to that class will acquire those style properties, such as span class="headline" • Tag: • In your stylesheet, store your style instructions under an html tag name • ALL objects of that type in the page (img for images, div for div boxes, a for hyperlinks, etc.) will have those style properties as their new defaults

More Related