Advertisement
makispaiktis

Codecademy - 13th Exercise (Instructions)

Oct 14th, 2019 (edited)
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. 1.
  2. The <header> currently scrolls with the rest of the document.
  3.  
  4. Set its position property so that it stays stuck to the top of the window when the document is scrolled.
  5.  
  6. Use position: fixed to fix an element to its position regardless of scrolling, for example:
  7.  
  8. selector {
  9. position: fixed;
  10. }
  11. 2.
  12. The <header> has shrunk!
  13.  
  14. Change the width of the same element so that it stretches across its entire parent element.
  15.  
  16. 3.
  17. List items (<li>) inside of the navigation section (<nav>) are currently displayed as a list.
  18.  
  19. Set their display property so that they can appear next to each other horizontally (but so that you still set their width in the next task).
  20.  
  21. inline-block will allow the <li> elements to flow horizontally on the same line and allow for you to set their width.
  22.  
  23. Select the elements using the selector nav li.
  24.  
  25. 4.
  26. Set the width of the same elements to 80 pixels.
  27.  
  28. 5.
  29. After changing the position of the <header> element to fixed, the contents of the entire site after it shifted upwards.
  30.  
  31. Set the position of <main> so that we can position it relatively.
  32.  
  33. 6.
  34. The <header> has disappeared behind the <main>.
  35.  
  36. Use z-index to make the <header> visible.
  37.  
  38. 7.
  39. Now the navigation bar looks good, but it is blocking the title at the top of the page.
  40.  
  41. Offset <main> by 80 pixels from the top.
  42.  
  43. 8.
  44. Now, fix up the supporting element style below the image.
  45.  
  46. Add a declaration to the .supporting .col rule set so that these elements can appear horizontally next to each other but have defined height and width.
  47.  
  48. display: inline-block will allow the .supporting .col elements to flow horizontally on the same line and allow you to set their dimensions.
  49.  
  50. 9.
  51. Inspect the .supporting .col elements—they don’t seem to be flowing horizontally yet because they have no set width. Set the width and height of .supporting .col elements to 200 pixels.
  52.  
  53. 10.
  54. Great work, the Broadway Design site looks much better!
  55.  
  56. If you want to continue coding, challenge yourself to make the <footer> element also fixed to the bottom of the page regardless of scrolling.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement