Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. HTML, CSS
  2.  
  3. A separation of concerns : HTML and CSS are
  4. 2 languages
  5.  
  6. HTML
  7. - Structure
  8. - Meaning (semantics)
  9.  
  10. Audience for your web page
  11. - You
  12. - Your team
  13. - Public
  14. - Google (search)
  15. - Screen reader
  16. - Software tools (e.g. HTML5 Outliner)
  17.  
  18. HTML 4.0.1
  19.  
  20. BLOCK LEVEL elements
  21.  
  22. - Create 1 column layout
  23. - Each element is on new line
  24. - 100% width of browser
  25. - Or 100% width of containing element
  26.  
  27. <p>Hello</p>
  28. <div>
  29. <h1><h6>
  30.  
  31. INLINE
  32. - Appear on the same line, i.e. no newline
  33.  
  34. <p>Fred Bloggs won the <span>Nobel Prize</span> for Physics</p>
  35.  
  36. Nested
  37.  
  38. <section class="oscars">
  39. <section class="2014">
  40. <section class="best-director">
  41. <section class="Scorcese"></section>
  42. <section class="Spielberg"></section>
  43. </section>
  44. </section>
  45. </section>
  46.  
  47.  
  48.  
  49. CSS
  50.  
  51. RULE-based stylesheet language
  52.  
  53. Generalised description of what a CSS rule looks like:
  54.  
  55. selector{
  56. property:value;
  57. property:value;
  58. }
  59.  
  60. ==================================
  61. Select all paragraphs
  62.  
  63. p{
  64. color:green;
  65. }
  66. ==================================
  67.  
  68. Selects everything with a CLASS of oxford
  69.  
  70. .oxford{}
  71.  
  72. <div class="oxford">
  73. <p class="oxford">
  74. <h4 class="oxford">
  75. <section class="oxford">
  76. ==================================
  77.  
  78. ID is for unique things
  79.  
  80. #cambridge{}
  81.  
  82. <p id="cambridge">
  83. ==================================
  84.  
  85. Style something which is a special offer, and its also furniture
  86.  
  87. <div class="offer furniture">
  88. <div class="furniture">
  89.  
  90. <div class="offer food">
  91. <div class="food">
  92. ==================================
  93.  
  94. CONTEXTUAL selectors
  95. Select something based on its relative position on the page (the DOM)
  96.  
  97. <div class="offer">
  98. <section></section>
  99. </div>
  100.  
  101. Something with a class of offer that CONTAINS a section
  102. .offer section{}
  103.  
  104. ==================================
  105.  
  106. ATTRIBUTE selectors
  107.  
  108. Good way to add METADATA to your HTML
  109.  
  110. Style with CSS
  111. Programmer can search for things with JS
  112.  
  113. <p data-next="w-2015-au-offer-lipsy">Green skirt</p>
  114.  
  115. BEGINS
  116. [data-next ^= "w-2015"] {}
  117.  
  118. CONTAINS
  119. [data-next *= "au"] {}
  120.  
  121. ENDS
  122. [data-next $= "lipsy"] {}
  123.  
  124. EQUALS
  125. [data-next = "w-2015-au-offer-lipsy"] {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement