Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Learn to code: Lesson 3

Avatar for Kevin Kevin
December 18, 2013

Learn to code: Lesson 3

Wrapping up the previous two lessons, and pushing everyone a little bit forward!

Avatar for Kevin

Kevin

December 18, 2013
Tweet

More Decks by Kevin

Other Decks in Programming

Transcript

  1. 1  Recap HTML 2  Recap CSS 3  Divide & Spanner

    4  Next steps over Christmas break
  2. HTML: Semantics, not design! •  HTML provides semantic structure to

    the web. •  HTML does not provide design or structure to the web. •  Humans are awesome at inferring structure & meaning. Web browsers? Not so much.
  3. What’s HTML look like again?! ! ! Opening tag |

    Content | Closing tag ! <h1>Beautiful headline</h1>!
  4. Attributes for CSS classes HTML allows us to add attributes

    to our tags, which let us add structure & style from CSS!   <h1 class=“something- awesome”>!
  5. HTML applied! How do you reckon this would look?  

    <p>Hey, <i>Jeetu</i>, did you see the <b>football match</b> <u>yesterday</ u>?</p>!
  6. Riddle me this… •  What tools do you need to

    write a web page? •  What are the primary sections of a web page? •  What file type is a web page? •  I need to add some structure to a page, what do I use?
  7. What do these mean? •  <em>! •  <i>! •  <strong>!

    •  <b>! •  <br>! •  <p>! •  <a>!
  8. CSS styles & structures the web •  Applied to your

    semantic HTML. •  Specifies how things appear on your pages. •  Selectors (tags in HTML) identify what to target our style with. •  A CSS class is denoted with a dot. •  A CSS i.d. is denoted with specific elements.
  9. Riddle me this… Explain these: •  Background-color! •  Font-size! • 

    Font-weight! •  Margin! •  Padding! •  float!
  10. NEW STUFF: how do we group sections up? •  So

    we have a bunch of content on our site. But we want to group some of it in a semantic way that will help us add specific styles & structure to that content. •  E.g. you want your list of hobbies to be styled & placed differently to your images or different kinds of content! •  We can do this with <div> or <span>!
  11. <div> & <span> •  <div> is simply a division of

    the site. It’s just a semantic mark to tell us & the browser to group this together. i.e. It does nothing to the page until you apply your CSS. •  <span> is similar, but it’s inline. Can anyone explain inline to us yet?!
  12. Div, Span, Class… •  Now tell me what this code

    does: <div class=“my-div”>! •  And in CSS…: .my-div { float: left; background-color: #404040; color: #fff; }!
  13. Make your sexy page proper sexy. You now know a

    lot more about HTML & CSS than you did only a month ago. GO YOU!
  14. TODO: 1  Wrap your web page elements with <div> tags

    & target them with CSS to float them left or right (i.e. put them side-by-side on a page). - You will run into difficulty with this. But use online resources to figure out the answer. We’ll review after break to help fix your problems.
  15. Bonus TODO: 1  Target divs on all of your pages

    with the same CSS. Now you see why we use CSS – to add redundancy to our code & add efficiencies to how we work! 2  Figure out how to target a specific div on a specific page to look magically different. i.e. Target a div on another page different to a previous.