1 course updates
play

1 Course updates Project user understanding phase: writeup due - PowerPoint PPT Presentation

CS 102 Human-Computer Interaction Lecture 12: HTML, HTTP, CSS and Javascript CS102: Monsoon 2015 1 Course updates Project user understanding phase: writeup due Monday Oct 12 Home page for each student due Wednesday Oct 14 (email zip fi le


  1. CS 102 Human-Computer Interaction Lecture 12: HTML, HTTP, CSS and Javascript CS102: Monsoon 2015 1

  2. Course updates Project user understanding phase: writeup due Monday Oct 12 Home page for each student due Wednesday Oct 14 (email zip fi le to us) WWW conference (submissions due in Oct, conference in April/May the following year) CS102: Monsoon 2015 2

  3. Reminder: HTML & CSS Intro https://www.codecademy.com/en/tracks/htmlcss (Complete the whole course) CS102: Monsoon 2015 3

  4. Recap CS102: Monsoon 2015 4

  5. HTML and HTTP 5 CS102: Monsoon 2015

  6. Evolution of HTML Very interesting language features Error tolerant Declarative Non-context-free grammar Dangling links are ok Original idea: Users would be able to edit pages End user customizable CS102: Monsoon 2015 6

  7. Common HTML tags <html>, <body> <table>, <tr>, <td> <div>, <span>, <p> <img> <a href=“…”> and <a name=“…”> <form>, <input>, <select> <ul>/<ol>, <li> <h1>…<h6> <iframe> CS102: Monsoon 2015 7

  8. Inspecting HTML and HTTP Go to http://ashoka.edu.in Document Object Model CS102: Monsoon 2015 8

  9. Cookies: fi rst access CS102: Monsoon 2015 9

  10. Cookies: second access CS102: Monsoon 2015 10

  11. HTTP caching Browser need not fetch previously fetched resources (html, images, CSS, JS) if they have not changed Server can control browser’s caching behavior CS102: Monsoon 2015 11

  12. Caching: max-age CS102: Monsoon 2015 12

  13. Caching: max-age After modi fi cation (< 60 seconds) CS102: Monsoon 2015 13

  14. Caching: max-age After modi fi cation (> 60 seconds) CS102: Monsoon 2015 14

  15. Caching: fi rst access CS102: Monsoon 2015 15

  16. Caching: second access Browser need not fetch previously fetched resources (html, images, CSS, JS) if they have not changed Server can control browser’s caching behavior CS102: Monsoon 2015 16

  17. Compression (needs server setup) CS102: Monsoon 2015 17

  18. Compression CS102: Monsoon 2015 18

  19. Ajax request CS102: Monsoon 2015 19

  20. Ajax response CS102: Monsoon 2015 20

  21. HTTP performance tips CS102: Monsoon 2015 21 http://stevesouders.com/examples/rules.php

  22. HTTP performance tips 1. Make fewer HTTP requests 8. External CSS and JS 2. Use a CDN 9. Reduce DNS lookups 3. Add an expires header 10. Minify Javascript (max-age) 11. Avoid redirects 4. Gzip components 12. Remove duplicate scripts 5 & 6. Put stylesheets at the 13. Con fi gure Etags top, scripts at the bottom. 14. Make AJAX cacheable 7. Avoid CSS expressions CS102: Monsoon 2015 22

  23. CSS 23 CS102: Monsoon 2015

  24. Cascading style sheets HTML is for content, CSS is for display Declarative syntax “Aspect-oriented” design Styles cascade in speci fi ed order Neat separation of View from Model CS102: Monsoon 2015 24

  25. CS102: Monsoon 2015 25 http://csszengarden.com/

  26. Basic CSS bindings Format: selector { prop1: val1; prop1: val1 } Selectors: tags, classes, ids, … div { color: green; } <div>…</div> .my_class { color: green; } <div class=“my_class”>…</div> #my_class { color: green; } <div id=“my_id”>…</div> … CS102: Monsoon 2015 26

  27. Basic CSS properties Box properties (padding, margin, border) Color and background Font and text (letter spacing, line-height, …) Visual layout (display, fl oat, dimensions, z-index, …) Pagination, cursor, etc. (Lots more in CSS 3) CS102: Monsoon 2015 27

  28. CSS box model CS102: Monsoon 2015 28

  29. Playing with CSS CS102: Monsoon 2015 29

Recommend


More recommend