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

HTML & CSS Basics

stupig
August 16, 2012

HTML & CSS Basics

HTML 与 CSS基础

stupig

August 16, 2012
Tweet

Other Decks in Programming

Transcript

  1. <!DOCTYPE> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    strict , transitional , frameset html4.0 & xhtml1.1 html4.0 ~ 12年8月28⽇日星期⼆二
  2. <!DOCTYPE> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    strict , transitional , frameset <!DOCTYPE html> html4.0 & xhtml1.1 html4.0 ~ 12年8月28⽇日星期⼆二
  3. <!DOCTYPE> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    strict , transitional , frameset <!DOCTYPE html> backward compatibility html4.0 & xhtml1.1 html4.0 ~ 12年8月28⽇日星期⼆二
  4. HTML elements block element div, p, h1~h6, ol, ul, li,

    dl, dt, dd, form, table, caption, thead, tbody, tfoot, tr, th, td, fieldset, legend, address, blockquato, pre, hr 12年8月28⽇日星期⼆二
  5. HTML elements block element inline element div, p, h1~h6, ol,

    ul, li, dl, dt, dd, form, table, caption, thead, tbody, tfoot, tr, th, td, fieldset, legend, address, blockquato, pre, hr 12年8月28⽇日星期⼆二
  6. HTML elements block element inline element div, p, h1~h6, ol,

    ul, li, dl, dt, dd, form, table, caption, thead, tbody, tfoot, tr, th, td, fieldset, legend, address, blockquato, pre, hr a, abbr, span, br, code, em, i, label, input, img, q, del, select, strong, sub, sup, textarea, input, button, select 12年8月28⽇日星期⼆二
  7. Global Attributes core attributes accesskey, class, dir, hidden, id, lang,

    style, tabindex, title 12年8月28⽇日星期⼆二
  8. Global Attributes core attributes accesskey, class, dir, hidden, id, lang,

    style, tabindex, title event-handler attributes 12年8月28⽇日星期⼆二
  9. Global Attributes core attributes accesskey, class, dir, hidden, id, lang,

    style, tabindex, title event-handler attributes onfocus, onchange, onclick, onblur, onload, onkeydown... 12年8月28⽇日星期⼆二
  10. Global Attributes core attributes accesskey, class, dir, hidden, id, lang,

    style, tabindex, title event-handler attributes onfocus, onchange, onclick, onblur, onload, onkeydown... xml attributes 12年8月28⽇日星期⼆二
  11. Global Attributes core attributes accesskey, class, dir, hidden, id, lang,

    style, tabindex, title event-handler attributes onfocus, onchange, onclick, onblur, onload, onkeydown... xml attributes xml:lang, xml:space, xml:base 12年8月28⽇日星期⼆二
  12. Semantic HTML what’s semantic HTML? Semantic HTML is the use

    of HTML markup to reinforce the semantics, or meaning, of the information in webpages rather than merely to define its presentation (look) -----------from http://en.wikipedia.org/wiki/Semantic_HTML 12年8月28⽇日星期⼆二
  13. Semantic HTML the good for semantic HTML lighter code accessibility

    search engine optimization 12年8月28⽇日星期⼆二
  14. Semantic HTML the good for semantic HTML lighter code accessibility

    search engine optimization repurposing 12年8月28⽇日星期⼆二
  15. Semantic HTML the good for semantic HTML lighter code accessibility

    search engine optimization repurposing developer comprehension 12年8月28⽇日星期⼆二
  16. Semantic HTML structure: body, head, html, title text: abbr, acronym,

    address, blockquote, br, cite, code, dfn, div, em, kbd, p, pre, q, samp, span, strong, var 12年8月28⽇日星期⼆二
  17. Semantic HTML structure: body, head, html, title text: abbr, acronym,

    address, blockquote, br, cite, code, dfn, div, em, kbd, p, pre, q, samp, span, strong, var topic: h1 ~ h6 12年8月28⽇日星期⼆二
  18. Semantic HTML structure: body, head, html, title text: abbr, acronym,

    address, blockquote, br, cite, code, dfn, div, em, kbd, p, pre, q, samp, span, strong, var topic: h1 ~ h6 link: a 12年8月28⽇日星期⼆二
  19. Semantic HTML structure: body, head, html, title text: abbr, acronym,

    address, blockquote, br, cite, code, dfn, div, em, kbd, p, pre, q, samp, span, strong, var topic: h1 ~ h6 link: a paragraph: p 12年8月28⽇日星期⼆二
  20. Semantic HTML structure: body, head, html, title text: abbr, acronym,

    address, blockquote, br, cite, code, dfn, div, em, kbd, p, pre, q, samp, span, strong, var topic: h1 ~ h6 link: a paragraph: p form: form, input label, select, option, textarea 12年8月28⽇日星期⼆二
  21. Semantic HTML structure: body, head, html, title text: abbr, acronym,

    address, blockquote, br, cite, code, dfn, div, em, kbd, p, pre, q, samp, span, strong, var topic: h1 ~ h6 link: a paragraph: p form: form, input label, select, option, textarea table: caption, table, td, th, tr 12年8月28⽇日星期⼆二
  22. Semantic HTML structure: body, head, html, title text: abbr, acronym,

    address, blockquote, br, cite, code, dfn, div, em, kbd, p, pre, q, samp, span, strong, var topic: h1 ~ h6 link: a paragraph: p form: form, input label, select, option, textarea table: caption, table, td, th, tr image: img 12年8月28⽇日星期⼆二
  23. Deprecation elements font, base, u, center, s, strike, isindex, menu,

    basefont, applet, acronym, big, tt, xmp, listing, plaintext, frame, frameset, noframe 12年8月28⽇日星期⼆二
  24. Deprecation elements font, base, u, center, s, strike, isindex, menu,

    basefont, applet, acronym, big, tt, xmp, listing, plaintext, frame, frameset, noframe attributes align, bgcolor, height, width, background... 12年8月28⽇日星期⼆二
  25. CSS history CSS 1.0 CSS 2.0 CSS 2.1 CSS 3

    12年8月28⽇日星期⼆二
  26. Selector priority selector style id class attribute priority * 0

    0 0 0 0 p 0 0 0 1 1 12年8月28⽇日星期⼆二
  27. Selector priority selector style id class attribute priority * 0

    0 0 0 0 p 0 0 0 1 1 div a 0 0 0 2 2 12年8月28⽇日星期⼆二
  28. Selector priority selector style id class attribute priority * 0

    0 0 0 0 p 0 0 0 1 1 div a 0 0 0 2 2 div a.color 0 0 1 2 12 12年8月28⽇日星期⼆二
  29. Selector priority selector style id class attribute priority * 0

    0 0 0 0 p 0 0 0 1 1 div a 0 0 0 2 2 div a.color 0 0 1 2 12 div .color .text 0 0 2 1 21 12年8月28⽇日星期⼆二
  30. Selector priority selector style id class attribute priority * 0

    0 0 0 0 p 0 0 0 1 1 div a 0 0 0 2 2 div a.color 0 0 1 2 12 div .color .text 0 0 2 1 21 div .color p #news 0 1 1 2 112 12年8月28⽇日星期⼆二
  31. Selector priority selector style id class attribute priority * 0

    0 0 0 0 p 0 0 0 1 1 div a 0 0 0 2 2 div a.color 0 0 1 2 12 div .color .text 0 0 2 1 21 div .color p #news 0 1 1 2 112 style=”” 1 0 0 0 1000 12年8月28⽇日星期⼆二
  32. Demo <div> <span>StuPig</span> </div> <style> div { color:green; } span

    { color:blue; } </style> 12年8月28⽇日星期⼆二
  33. Demo <div id="meituan" class="b a"> <span>StuPig</span> </div> <style> .a {

    color:green; } .b { color:blue; } </style> 12年8月28⽇日星期⼆二
  34. Demo <div id="meituan" class="b a"> <span>StuPig</span> </div> <style> div {

    color:green!important; } #meituan { color:blue; } </style> 12年8月28⽇日星期⼆二
  35. Demo <div id="meituan" class="b a"> <span>StuPig</span> </div> <style> div span

    { color:green; } span { color:blue; } </style> 12年8月28⽇日星期⼆二
  36. Clear float clear: left | right | both | none

    12年8月28⽇日星期⼆二
  37. Clear float clear: left | right | both | none

    clearfix: 12年8月28⽇日星期⼆二
  38. Clear float clear: left | right | both | none

    clearfix: .clearfix:after { content: ’ ’; visibility: hidden; display: block; font-size: 0; clear: both; height: 0; } 12年8月28⽇日星期⼆二