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

HTML & CSS

Jerry Hu
January 26, 2014

HTML & CSS

Learn the basics of HTML and CSS. Talk by Jerry Hu. Some examples taken from HTML & CSS by Jon Dukett.

Jerry Hu

January 26, 2014
Tweet

Other Decks in Programming

Transcript

  1. This is the main heading ! subdetails subdetails subdetails subdetails

    subdetails subdetails subdetails subdetails ! 2nd heading ! subdetails subdetails subdetails subdetails subdetails subdetails subdetails subdetails ! 3rd heading ! subdetails subdetails subdetails subdetails subdetails subdetails subdetails subdetails
  2. <html> <header> <title>title of the page</title> </header> <body> <h1>This is

    the main heading</h1> <p>subdetails</p> ! <h2>2nd heading</h2> <p>subdetails</p> ! <h3>3rd heading</h3> <p>subdetails</p> </body> </html> HTML
  3. <html> <header> <title>title</title> </header> <body> <h1>main heading</h1> <p>subdetails</p> ! <h2>2nd

    heading<h2> <p>subdetails</p> ! <h3>3rd heading</h3> <p>subdetails</p> </body> </html> This is the main heading ! subdetails subdetails subdetails subdetails ! 2nd heading ! subdetails subdetails subdetails subdetails ! 3rd heading ! subdetails subdetails subdetails subdetails HTML
  4. <p>

  5. This is the main heading ! subdetails subdetails subdetails subdetails

    subdetails subdetails subdetails subdetails ! 2nd heading ! subdetails subdetails subdetails subdetails subdetails subdetails subdetails subdetails ! 3rd heading ! subdetails subdetails subdetails subdetails subdetails subdetails subdetails subdetails
  6. This is the main heading ! subdetails subdetails subdetails subdetails

    subdetails subdetails subdetails subdetails ! 2nd heading ! subdetails subdetails subdetails subdetails subdetails subdetails subdetails subdetails ! 3rd heading ! subdetails subdetails subdetails subdetails subdetails subdetails subdetails subdetails
  7. <html> <header> <title>2nd example</title> </header> <body> <h1>This is the main

    heading</h1> <p><i>subdetails</i></p> ! <h2>2nd heading<h1> <p><b>subdetails</b></p> ! <h3>3rd heading</h3> <p>subdetails<br />subdetails</p> </body> </html> HTML
  8. <html> <header> <title>2nd example</title> </header> <body> <h1>This is the main

    heading</h1> <p><i>subdetails</i></p> ! <h2>2nd heading<h1> <p><b>subdetails</b></p> ! <h3>3rd heading</h3> <p>subdetails<br />subdetails</p> </body> </html> HTML
  9. This is the main heading ! subdetails subdetails subdetails subdetails

    subdetails subdetails subdetails subdetails ! 2nd heading ! ! ! ! ! subdetails subdetails subdetails subdetails subdetails subdetails subdetails subdetails ! 3rd heading ! subdetails subdetails subdetails subdetails subdetails subdetails subdetails subdetails
  10. <html> <header> <title>tangent 1</title> </header> <body> <h1>This is the main

    heading</h1> <p><i>subdetails</i></p> ! <h2>2nd heading<h1> <p><b>sub<img src=“r.jpg” />details</b></p> ! <h3>3rd heading</h3> <p>subdetails<br />subdetails</p> </body> </html> HTML
  11. <html> <header> <title>tangent 1</title> </header> <body> <h1>This is the main

    heading</h1> <p><i>subdetails</i></p> ! <h2>2nd heading<h1> <p><b>sub<img src=“r.jpg” />details</b></p> ! <h3>3rd heading</h3> <p>subdetails<br />subdetails</p> </body> </html> HTML
  12. <html> <header> <title>tangent 2</title> </header> <body> <!—-comment about code—-> <h1>This

    is the main heading</h1> <p><i>subdetails</i></p> ! <h2>2nd heading<h1> <p><b>subdetails</b></p> ! <h3>3rd heading</h3> <p>subdetails<br />subdetails</p> </body> </html> HTML
  13. <html> <header> <title>3rd example</title> </header> <body> <h1>This is the main

    heading</h1> <p class=“subdetails” id=“t”>subdetails</p> ! <h2>2nd heading<h1> <p class=“subdetails” id=“m”>subdetails</p> ! <h3>3rd heading</h3> <p class=“subdetails” id=“b”>subdetails</p> </body> </html> HTML
  14. <html> <header> <title>4th example</title> </header> <body> <div id=“header”> <h1>My Webpage</h1>

    <!—-<img src=“r.jpg” title=“me”/>—-> <p id=“slogan”>Welcome to my webpage</p> </div> ! <div id=“content”> <h2 class=“title”>2nd heading<h1> <p class=“post”>subdetails</p> ! <h3 class=“title”>3rd heading</h3> <p class=“post”>subdetails</p> </div> </body> </html> HTML
  15. <html> <header> <title>4th example</title> </header> <body> <div id=“header”> <h1>My Webpage</h1>

    <!—-<img src=“r.jpg” title=“me”/>—-> <p id=“slogan”>Welcome to my webpage</p> </div> ! <div id=“content”> <h2 class=“title”>2nd heading<h1> <p class=“post”>subdetails</p> ! <h3 class=“title”>3rd heading</h3> <p class=“post”>subdetails</p> </div> </body> </html> HTML
  16. This is the main heading ! welcome to my webpage

    ! 2nd heading ! subdetails subdetails subdetails subdetails subdetails subdetails subdetails subdetails ! 3rd heading ! subdetails subdetails subdetails subdetails subdetails subdetails subdetails subdetails
  17. <html> <header> <title>4th example</title> </header> <body> <div id=“header”> <h1>My Webpage</h1>

    <!—-<img src=“r.jpg” title=“me”/>—-> <p id=“slogan”>Welcome to my webpage</p> </div> ! <div id=“content”> <h2 class=“title”>2nd heading<h1> <p class=“post”>subdetails</p> ! <h3 class=“title”>3rd heading</h3> <p class=“post”>subdetails</p> </div> </body> </html> HTML
  18. <html> <header> <title>4th example</title> </header> <body> <div id=“header”> <h1>My Webpage</h1>

    <!—-<img src=“r.jpg” title=“me”/>—-> <p id=“slogan”>Welcome to my webpage</p> </div> ! <div id=“content”> <h2 class=“title”>2nd heading<h1> <p class=“post”>subdetails</p> ! <h3 class=“title”>3rd heading</h3> <p class=“post”>subdetails</p> </div> </body> </html> HTML
  19. <html> <header> <title>4th example</title> </header> <body> <div id=“header”> <h1>My Webpage</h1>

    <!—-<img src=“r.jpg” title=“me”/>—-> <p id=“slogan”>Welcome to my webpage</p> </div> ! <div id=“content”> <h2 class=“title”>2nd heading<h1> <p class=“post”>subdetails</p> ! <h3 class=“title”>3rd heading</h3> <p class=“post”>subdetails</p> </div> </body> </html> HTML
  20. body { background-color: rgba(86,98,111,1); } #header { font-size: 20px; }

    #slogan { font-family: cursive; color: green; font-size: 12px; } #content { font-family: sans; } .title { font-size: 15px; } .post { font-size: 12px; font-family: serif; } CSS
  21. <html> ! <head> ! <title>Title</title> ! <style> /*styles go here*/

    </style> ! </head> ! <body> <!—-Content—-> </body> ! </html> HTML
  22. <html> ! <head> ! <title>Title</title> ! <style> /*styles go here*/

    </style> ! </head> ! <body> <!—-Content—-> </body> ! </html> <btw this is a css comment HTML
  23. * { font-family: Helvetica, Arial, sans; } h1 { font-family:

    “Cooper Black”; } i { color: green; } i { color: red; } b { color: pink; } p b { color: blue !important; } p b { color: violet; } CSS
  24. p#intro { font-size: 12px; } p { font-size: 10px; YOLO

    ! SWAG SWAG SWAG ! #YOLOSWAG #OBEY YIELDS: CSS
  25. body { font-family: Helvetica, Arial, sans; color: #efefef; padding: 20px

    10px 5px 10px; background-color: gray; } #page { border: 1px solid #efefef; background-color: #111; padding: inherit; } CSS HTML <div id=“page”> <h1>Aplannr</h1> <p>Aplannr is a drag and drop planner app</p> <p>It won best in state in a competition<p> </div>
  26. ! ! ! Aplannr! ! ! Aplannr is a drag

    and drop planner app! ! ! It won best in state in a competition
  27. 1em based on size of “m” 12px based on pixels

    12pt based on standard 100% based on 16px font
  28. #article { border: 1px solid #efefef; background-color: #111; height: 100px;

    width: 75%; min-width: 200px; max-width: 500px; } CSS
  29. #article { border: 1px solid #efefef; background-color: #111; height: 100px;

    width: 75%; min-width: 200px; max-width: 500px; overflow: hidden; } CSS
  30. #article { border: 1px solid #efefef; background-color: #111; height: 100px;

    width: 75%; min-width: 200px; max-width: 500px; overflow: scroll; } CSS
  31. ! ! ! Aplannr! ! ! Aplannr is a drag

    and drop planner app! ! ! It won best in state in a competition
  32. body { font-family: Helvetica, Arial, sans; color: #efefef; padding: 20px

    10px 5px 10px; background-color: gray; } #page { border: 1px solid #efefef; background-color: #111; padding: inherit; } CSS HTML <div id=“page”> <h1>Aplannr</h1> <p>Aplannr is a drag and drop planner app</p> <p>It won best in state in a competition<p> </div>
  33. Lorem ipsum: ! Lorem ipsum dolor sit amet, consectetur adipisicing

    elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum Lorem ipsum: ! Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
  34. #article { height: 300px; width: 500px; margin: 10px auto 10px

    auto; padding: 8px 2px 8px 2px; } CSS N E S W