Guest User

Untitled

a guest
Mar 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.79 KB | None | 0 0
  1. Part I: HTML
  2.  
  3. 1. What is a block element and how does it flow on the screen?
  4.  
  5. Block-level elements are used to occupy the entire space of its parent element and it flows more on the screen as it affects the larger structure and commonly correspondes to the flow content of screens.
  6.  
  7. 2. What is an inline element and how does it flow on the screen?
  8.  
  9. Inline elements define only the space bounded by tages in order to avoid breaking the flow of content. Which is the reason inline elements provide comparebly less flow, and is commonly associated with phrasing content.
  10.  
  11. 3. What box model properties are unavailable for inline elements?
  12.  
  13. The width and height of properties of box model are not available to the inline elements.
  14.  
  15. 4. List 3 inline elements that are most commonly used?
  16.  
  17. The most commonly used inline elements that are used are <span>, <a>, and <img>.
  18.  
  19. 5. What are semantic tags and why use them?
  20.  
  21. Semantic tags are tags that clearly define the content in them, and are used to describe the meaning or use of the tag for a specific set of content.
  22.  
  23. 6. What are 2 grouping tags (one inline, one block)
  24.  
  25. Two grouping tags are <div> for block-level, and <span> for inline.
  26.  
  27. 7. Write the HTML5 tags we use to structure a page, in the order you might use them?
  28.  
  29. <html>
  30. <head>
  31. <title></title>
  32. </head>
  33. <body>
  34. <h1></h1>
  35. <p></p>
  36. </body>
  37. </html>
  38.  
  39. 8. What is the difference between a tag and an element?
  40.  
  41. The difference between tag and elements is that tags are used to indicate that start and end of an HTML element, while elements are indicative of a structure or semantics as they commonly include start tag, content, and an end tag.
  42.  
  43. 9. What is the box model (Explain it)?
  44.  
  45. Box model can be described as the design and layout of CSS. The box model consists of margins, borders, padding, and content, whiel wrapping around every HTML element.
  46.  
  47. 10. How does the box-sizing: border-box; rule modify the box model?
  48.  
  49. Box-sizing is used to define the width and height of an element are calculated whether or not padding and borders are included.
  50.  
  51. 12. On form tags such as input, what attribute links a label to the form element?
  52.  
  53. The id attribut links the input tag in this case to the for element in the label element of a form tag.
  54.  
  55. 13. Are input, button and textarea block or inline tags?
  56.  
  57. Inline tages
  58.  
  59. 14. What is the viewport meta tag used for?
  60.  
  61. Viewport meta tag is mainly used for controling the dimensions and scaling of a page.
  62.  
  63. Part II: CSS
  64.  
  65. 13. How do you separate multiple CSS selectors in the same rule set?
  66.  
  67. The way to separate multiple CSS selectors in the same rule set is by using a comma.
  68.  
  69. 14. In the following selector, what does the space mean between the tag names?
  70.  
  71. section p { property: value; }
  72.  
  73. The space means that the p tag is the decendant selector of the ancestor element section in this descendent combinator.
  74.  
  75. 15. How do you select the 2nd paragraph tag in CSS without modifying the HTML:
  76.  
  77. <main>
  78.  
  79. <h1>Welcome</h1>
  80.  
  81. <p>Hi</p>
  82.  
  83. <p>Hello</p>
  84.  
  85. <p>Hey</p>
  86.  
  87. </main>
  88.  
  89. <style> // You modify the 2 paragraph using the general sibling selector and its symbol ~.
  90.  
  91. h1 ~ p {
  92. }
  93.  
  94. </style>
  95.  
  96. 16. Write the CSS to show the menu items only when hovering over the nav
  97.  
  98. <nav>
  99.  
  100. <h2>MENU</h2>
  101.  
  102. <ul>
  103.  
  104. <li><a href="#">Home</a></li>
  105.  
  106. <li><a href="#">About</a></li>
  107.  
  108. <li><a href="#">Contact</a></li>
  109.  
  110. </ul>
  111.  
  112. </nav>
  113.  
  114. <style>
  115. li a {
  116. display: block;
  117. }
  118. </style>
  119.  
  120. 17. Which category of CSS properties are all inherited?
  121.  
  122. The category of CSS properties passed by child elements are commonly all inherited.
  123.  
  124. 18. What do the units vw and vh mean?
  125.  
  126. vw and vh are relative length units where vw is relative to 1% of the width of the viewport*, and vh is relative to 1% of the height of the viewport*.
  127.  
  128. 19. How do you set a top-margin to 2% of a site's width?
  129.  
  130. You can set the top-margin of a site's width by including body { margin-top: 2%;} in your CSS.
  131.  
  132. 20. What are the 2 methods we've used to make block elements flow horizontally; what are the side effects of each method?
  133.  
  134. The two elements that we commonly used are floating and clear. Some side effects of these two methods are that you may want to force floats to move below a floated line which could be fixed by clearing and clearing can also cause overflows in which case a clearfix element can be used to correct this issue.
  135.  
  136.  
  137. 21. What are collapsing margins and how do you address them?
  138.  
  139. Collapsing margins are when the top and bottom margins of elements are sometimes collapsed into a singal margin, which is also equal to the largest of the two margins. When adressing collapsing margins it is best to use the overflow element and setting it to auto.
  140.  
  141. 22. Write the CSS property: value to make an inline element flow vertically?
  142.  
  143. display: inline-block;
  144. vertical-align: middle;
  145.  
  146. 23. Write the CSS property: value to horizontally center a fixed-width block element inside a parent?
  147.  
  148. margin: 0 auto;
  149.  
  150. 24. Write the CSS property: value to vertically center a this text if the section tag's height is 100px:
  151.  
  152. <section>Hello</section>
  153.  
  154. section {
  155. height: 100px;
  156. text-align: center;
  157. }
  158.  
  159. 25. In which HTML tag rule set is it good practice to place all font/text default properties in CSS and why?
  160.  
  161. It is good practie to place all font/text defult properties in a @font-face rule, so any font/text can first have a defined name in the font-family for later use when called upon.
  162.  
  163. 26. For floated elements inside a parent, how do we fix the parent's height from
  164.  
  165. collapsing? State the answer and write the CSS.
  166.  
  167. We can fix the parent's height from collapsing by adding a div tag with a class "clearfix" and adding to the CSS:
  168.  
  169. .clearfix::after {
  170. content: "";
  171. clear: both;
  172. display: table;
  173. }
  174.  
  175. 27. What CSS property: value; is used to stop a unfloated element from sliding
  176.  
  177. up and behind it's floated, previous sibling?
  178.  
  179. The CSS property float: none; can be implimented to stop any sibling element from wrapping around previous sibling.
  180.  
  181. 28. position: relative positions an element is relative to what?
  182.  
  183. Relative to its normal postion.
  184.  
  185. 29. For non-static positioning, what additional properties are required?
  186.  
  187. Top, bottom, left, and right margins.
  188.  
  189. 30. The position (eg, properties top, bottom, left or right) of absolute-positioned elements are in reference to what?
  190.  
  191. Final position
  192.  
  193. 31. What do each of these selectors mean? (state what is selected for each)
  194.  
  195. article>p This selects all the <p> elements where the parent element is a <article> element.
  196.  
  197. nav li:nth-child(2):hover This selects every <li> element second to the parent <nav> element when mouse course is over it.
  198.  
  199. p::after (and what property is the partner to this selector) This allows for inserting of properties after the content of each <p> element.
  200.  
  201. p+img This selects all the img elements immediatly following the <p> element.
  202.  
  203. input[type="radio"] This is used to define a radio button and selecting one button out of many to assign.
  204.  
  205. 32. How do you set default styles in a website so the box model values are predictable for all elements across multiple browsers?
  206.  
  207. In order to set defult styles in a website you can use a reset stylesheet and @import into the CSS stylesheet.
  208.  
  209. 33. How do you use google fonts and from which file to you access them (HTML or CSS)?
  210.  
  211. In order to use google fonts you can use @import url and the link with the fonts you have selected included and placed on the CSS style sheet.
Add Comment
Please, Sign In to add comment