1 / 9

GBK Programming 1

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>

munin
Download Presentation

GBK Programming 1

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. GBK Programming 1 Jordan Johnson

  2. Today’s plan Greeting Quick “quiz-yourself” question. DIVs and SPANs,Block & Inline Elements Clean-up

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

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

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

  6. 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; }

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

  8. Your Tasks • Add blocks to your page(s) for major sections • Header area • Body text • Sidebar? • Reminder: Site due tonight.

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

More Related