Publicidad

HTML5 and CSS3 Refresher

Assistant professor at Vrije Universiteit Amsterdam en Vrije Universiteit Amsterdam / VU
11 de Apr de 2013
Publicidad

Más contenido relacionado

Publicidad

Más de Ivano Malavolta(20)

Publicidad

HTML5 and CSS3 Refresher

  1. • • •
  2.   – – –
  3. – – – – –
  4. • • • • • • • • • •
  5. – • – • – • –
  6. <!DOCTYPE html> <html> <head> <title>Title</title> </head> <body> … </body> </html>
  7. • • • • • • • • • •
  8. • • •
  9. <header> <footer> <nav> <section> <article> <aside>
  10. http://bit.ly/JCnuQJ
  11. <command> <details> <summary> <meter> <progress> <figure> <figcaption> <mark> <time> <wbr>
  12. data- getAttribute()
  13. • • • • • • • • • •
  14. <input type="search"> <input type="number"> <input type="range"> <input type="color"> <input type="tel"> <input type="url"> <input type="email"> <input type="date"> <input type="month"> <input type="week"> <input type="time"> <input type="datetime"> <input type="datetime-local">
  15. <input type="text“ autofocus> – <input type="text“ placeholder=“your name”>
  16. • • • • • • • • • •
  17. <audio> <audio controls> <source src="song.ogg" type="audio/ogg" /> <source src="song.mp3" type="audio/mpeg" /> Not Supported </audio> sources 
  18. play() pause() load() currentTime ended volume… 
  19. <video> <video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4" /> <source src="movie.ogg" type="video/ogg" /> Not Supported </video> sources 
  20. play() pause() load() currentTime ended volume… 
  21. <video> <iframe width="560" height="315" src="http://www.youtube.com/embed/Wp20Sc8qPeo" frameborder="0" allowfullscreen></iframe>
  22. • • • • • • • • • •
  23. • • • • • • • • • •
  24. function getLocation() { if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { console.log(„no geolocalization‟); } } function showPosition(position) { console.log(position.coords.latitude); console.log(position.coords.longitude); }
  25. • • • • • • • • • • •
  26. • • • • • • • • • •
  27.  
  28. • • • •
  29. • • • • • • • • • •
  30. • • • • • • • • • •
  31. • •
  32. var worker = new Worker(“worker.js”);
  33. $(„#button‟).click(function(event) { $(„#output‟).html(“starting”); worker.postMessage(“start”); }); worker.onmessage = function(event) { $(„#output‟).html(event.data); }
  34. onmessage = function(event) { if(event.data === “start”) { var result; // do something with result postMessage(result); } }
  35. • • • • • • • •
  36. – – – – – – –
  37. • • • • • • • •
  38. selector { property: value; property2: value2, value3; ... }
  39.  body { background-color: red; } div { background-color: green; }
  40. h1, h2, h3 { background-color: red; }
  41. div { list-style-image: url(image.png); list-style-position: inside; list-style-style: circle; }
  42. div { background:url(img.png), url(img2.png); background-size:80px 60px; background-repeat:no-repeat; background-origin:content-box; }
  43. div { background-color: blue; background-color: rgba(0, 0, 255, 0.2); background-color: hsla(240, 100%, 50%, 0.2); }
  44. div { background: -webkit-gradient(linear, right top, left bottom, from(red), green)); } linear  right-top  left-bottom  from  to 
  45. p { color: grey; letter-spacing: 5px; text-align: center; text-decoration: underline; text-indent: 10px; text-transform: capitalize; word-spacing: 10px; }
  46. p { text-shadow: 2px 10px 5px #FF0000; text-overflow: ellipsis; word-wrap:break-word; }    
  47. • • • • • • • •
  48. a { color: red; } • #redLink { color: red; } • redLink { color: red; }
  49.  •  •  •  target •  target= "_blank“ • 
  50.  "https” •  ".pdf” •  “mobile“ •  •  • 
  51. • • • • • • • •
  52. div { width: 100px; height: 40px; padding: 10px; border: 5px solid gray; margin: 10px; border-radius: 10px; box-shadow: 10px 10px 5px red; }
  53. div { border-image:url(border.png) 30 30 round; }
  54. • • • • • • • •
  55. div { display: none; }
  56. block • inline • • inline-block •
  57. div.hidden { visibility: hidden; } visible, collapse, inherit
  58. box: • • box-orient #div { display: box; box-orient: horizontal; }
  59. display: box box-orient box-direction
  60. box-pack box-orient: horizontal; box-pack: end;
  61. box-align box-orient: horizontal; box-align: center;
  62. width box-flex #box1 { width: 100px; } #box2 { box-flex: 1; } #box3 { box-flex: 2; }
  63. • • • • •
  64. • • • • • • • •
  65. @font-face { font-family: NAME; src: url(Dimbo.ttf); font-weight: normal; font-style: normal; }
  66. NAME div { font-family: NAME; }
  67. • • • • • • • •
  68. – all • – • – • –
  69. .imageThumbnail { width; 200px; transition: all ease-in 3s; } .zoomed { position: absolute; left: 0px; top: 0px; width: 480px; } $(„.imageThumbnail‟).addClass(„zoomed‟);
  70. div { animation: test 5s ease-in; }
  71.  
  72. @keyframes test{ 0% {background: red; left:0px; top:0px;} 25% {background: yellow; left:200px; top:0px;} 50% {background: blue; left:200px; top:200px;} 75% {background: green; left:0px; top:200px;} 100% {background: red; left:0px; top:0px;} }
  73. – – • – – • – –
  74. • • • • • • • •
  75. • • • •
  76. <link rel=“stylesheet” href=“style.css” media=“screen” /> • @media screen { div { color: red; } }
  77. • • • •
  78. @media screen and orientation: portrait
  79. @media screen and (max-device-width: 480px){ /* your style */ }
  80. @media screen and (color), handheld and (color) { /* your style */ }
  81. @media not (width:480px) { /* your style */ }
  82. @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { /* Styles */ }
  83. @media only screen and -webkit-min-device-pixel-ratio: 2 @media only screen and (device-width: 768px) and (orientation: landscape) @media only screen and (min-device-width: 320px) and (max-device-width: 480px)
  84. – – • – –
  85. – • – • –
  86. – •
Publicidad