1 / 24

Page Structure, Box Model, Colors

Page Structure, Box Model, Colors. 21 January 2014. From the first two labs. Common Mistakes. Validating on your machine, not isis Remember Fred Flintstone : Head and body AND NOTHING ELSE Look at effect of commands font-style: inherit;. Page Structure. The Body. Every page needs

amalia
Download Presentation

Page Structure, Box Model, Colors

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. Page Structure, Box Model, Colors 21 January 2014

  2. From the first two labs

  3. Common Mistakes • Validating on your machine, not isis • Remember Fred Flintstone: • Head and body AND NOTHING ELSE • Look at effect of commands • font-style: inherit;

  4. Page Structure

  5. The Body • Every page needs • Header (DIFFERENT THAN head) • Content • Footer • Minimal content • Header: title • Footer: who wrote it and when

  6. Dividing Up the Body Basic model: <header>…</header> Use for main title <main> … </main>* Use for the main content <footer> … </footer> Use for accreditations and citations Each section can be formatted independently * New tag, may not be offered by komodo editor

  7. Box Model

  8. Box Model Allows us to place borders, and space elements in relation to other elements Here’s where Inspect Element starts being important!

  9. Box Model • Margin – clears an area around the border. Does not have a background color – it is transparent • Border – a border that goes around the padding and content. Affected by the background color of the box. • Padding – clears an area around the content. Affected by background color of the box • Content – the content of the box, where text appears.

  10. A cool new feature • Rounded corners on boxes • border-radius: 15px; • New with the latest version of CSS • If not supported by a browser, you get square corners!

  11. Centering centering the TEXT text-align: center; centering the BOX Need to tell it to treat as a block display: block; Must have a width (px or %) center using margin margin-left: auto; margin-right: auto;

  12. Centering list items • One of the areas with browser differences • In some cases (Firefox), centering text centers the bullet • In other cases (Chrome), centering text does not center the bullet • Solution: list-style-position: inside; bullets INSIDE the list item’s formatting

  13. Colors

  14. Colors – Paint (Subtractive Color Model) • Primaries: magenta, yellow, and cyan • This color system is called subtractive because: • each primary color absorbs (subtracts) a certain part of the color spectrum. • every time a color is added, less light is reflected. • When you mix all three primaries together, the entire spectrum of color is absorbed, and we’re left with black.

  15. Colors -- Computer Screen (Additive Color System) • Primaries: Red, Blue, Green • Additive color systems start without light (black). • Light sources combine to make a color. • As colors are added, the resulting color is brighter.

  16. Colors • We’ll be working with the additive color system • Mix various amounts of red, green, and blue to create a color. • Colors can be represented by • name • an rgb (dec, dec, dec) value • hexadecimal (# hxhxhx) value.

  17. Colors (cont) • For RGB, each color is indicated by a number from 0-255 • (0,0,0) = black • (255,255,255) = white • For Hexadecimal (hex), each color is indicated by 6 values from 0 – F • #000000 = black • #FFFFFF = white

  18. Hex... #ADFAA5 • Each two letters/numbers represent red, green, or blue in that order. • Examples: • #FF0000 = red • #00FF00 = green • #0000FF = blue #E01B4C #0F6480

  19. Why Hexadecimal? • How do computers store information? • Bits 1 and 0 • Binary numbers are too hard to use • Group them together in groups of 4 • That’s hexademical!

  20. Color Shorthand • Sometimes you will see colors as #123 • This is the same as #112233 • Why? Still a pretty broad range of colors http://www.december.com/html/spec/color3hex1.html

  21. Helpful Color Links • A list of color names • colorpicker.com

  22. Identifying Colors • Eyedropper for Chrome • Colorzilla for Firefox • Colorpic

  23. Special Characters

  24. Special symbols • < and > are special symbols with special meanings How would you display A < B ? Suggestions? • &lt; for < and &gt;for > & is an escape symbol, handled specially. Always ends with ; • Means that you need a special way to display “&” too: &amp; • Full lists at http://www.w3schools.com/tags/ref_entities.asp http://www.utexas.edu/learn/html/spchar.html

More Related