90 likes | 207 Vues
GBK Programming 1. Jordan Johnson. Today’s plan. Greeting Quick “quiz-yourself” question. DIVs and SPANs , Block & Inline Elements Clean-up. What would you change? (Take 3 minutes, write changes). <html> <body> <center>My Favorite Animals</center> <ul>
E N D
GBK Programming 1 Jordan Johnson
Today’s plan Greeting Quick “quiz-yourself” question. DIVs and SPANs,Block & Inline Elements Clean-up
What would you change?(Take 3 minutes, write changes) <html> <body> <center>My Favorite Animals</center> <ul> <li><strong>Zebras</strong></li> <p>I like these because they're striped.</p> <li><strong>Platypuses</strong></li> <p>I like these because they're kinda like ducks.</p> <li><strong>Armadillos</strong></li> <p>They're armored (but they smell bad).</p> </ul> </body> </html>
Block vs. Inline Display • New tags: • <div>...</div> • "division", or block of text in the page • <span>…</span> • “span” of text, or a snippet of text in a line. • Difference: • “Block” vs. “inline” • An inline object is treated like a letter in the paragraph that contains it. • A block element starts a new line before and after it, takes all horizontal space available (by default).
Examples • Elements displayed as blocks (by default): • H1…H6 • P, TABLE, FORM, BLOCKQUOTE • UL, OL, DL, LI, … • DIV • Elements displayed as inline (by default): • A • STRONG, EM • KBD, SAMP, CODE, ABBR, ACRONYM • INPUT, IMG • SPAN
Controlling Block/Inline Display • The CSS display property sets block vs. inline display. Examples (in stylesheets): • img { display: block; } • li { display: inline; } • display can also tell the browser not to show something at all: • img { display: none; }
Demo …on the server. Includes example of making a horizontal navigation menu by setting LI elements’ display to inline. For more info, see http://www.alistapart.com/articles/taminglists/
Your Tasks • Add blocks to your page(s) for major sections • Header area • Body text • Sidebar? • Reminder: Site due tonight.
Clean-up • Before you leave, please . . . • Log out. • Push in your chair. • Make sure you’ve got everything. • Make sure all trash ends up in the trash can.