Guest User

Untitled

a guest
Aug 2nd, 2025
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 4.13 KB | None | 0 0
  1. body {
  2.     /* temporary css that clarifies how the body tag works  */
  3.     /* Only affects the bottom part of the screen and not the header because the header overrides it? */
  4.     /* Is this correct ?  */  
  5.     background: pink;
  6.     font-family: "Ubuntu", sans-serif;
  7. }  
  8.  
  9.  
  10. /* ****************************************************************
  11. Typography
  12. **************************************************************** */
  13.  
  14. .title {
  15.   font-family: "Lora", serif;
  16.   font-weight: 400;
  17.   color: #143774;
  18.   font-size: 2rem;
  19. }
  20.  
  21.  
  22.  
  23. .seccondary-title {
  24. font-weight: 700;
  25. color: #1792d2;
  26. }
  27.  
  28.  
  29. .title, .seccondary-title {
  30.   /* Decreases the space between the h1 and h2 elements. header elements by default have space. */
  31.   line-height: 1;
  32. }
  33.  
  34.  
  35.  
  36. /* **************************************************************
  37. Layout
  38. **************************************************************** */
  39.  
  40.  
  41. /*
  42. For every device width.
  43. Because of the media query below this will also affect smaller screen sizes.
  44. */
  45. header {
  46.     /* temporary css that clarifies how the header element works */
  47.     border: 8px dotted red;    
  48.     /* review centering things with css */
  49.     /* centers the text in the titles  */
  50.     text-align: center;
  51. }
  52.  
  53.  
  54. /* If the device width is greater than or equal to 800px */
  55. @media (min-width: 800px) {
  56.     header {
  57.         /* increase the padding in the up+down direction why? */
  58.         padding: 2em 0;    
  59.         /*Create Space between the titles and the navbar when they get to close on bigger screens*/
  60.         /* why does margin make the box smaller? */
  61.         padding: 0 1em;
  62.         /* todo add spacing!!! spaces the titles and the navbar justify-content: space-evenly; */    
  63.  
  64.         /* Are the 2 lines needed below? yes */
  65.         width: 90%;
  66.         max-width: 800px; /* how to know the size of this? */
  67.  
  68.     }  
  69. }
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76. /* ****************************************************************
  77. Navigation
  78. ****************************************************************   */
  79.  
  80. nav ul, .searchform {
  81.     display: flex;
  82.     /* puts the nav links on different lines */
  83.     flex-direction: column; /* not defalut value */
  84.     /* temporary css that clarifies how the nav ul element works    */
  85.     border: 5px solid blue;
  86.     /* removes the dots in the list for the navbar */
  87.     list-style: none;
  88.     /* Makes it so the navbar doesn't have space on the left and right side and aligns it to the left. */
  89.     padding: 0;
  90.     /*
  91.     Don't use "justify-content: space-between;" because the space is to big on big screens between navbars
  92.     "witdh:..." won't work because there could be multiple navbar links and it won't properly space it.
  93.     The solution is to use nav li {margin 0 1em} in the  navbar links.
  94.     */
  95.  
  96.     /* centers the navbar, "text-align: center;" in header doesn't affect it due to the flexbox. */
  97.     margin: 0 1em;
  98. }
  99.  
  100. /* If the device width is greater than or equal to 800px */
  101. @media (min-width: 800px) {
  102.     nav ul, .searchform {
  103.         /* puts the nav links on the same horizonatal line */
  104.         flex-direction: row; /* defalut value */
  105.     }
  106.  
  107. }
  108.  
  109.  
  110.  
  111. nav li {
  112.     /* temporary css that clarifies how the element works */
  113.     border: 3px solid yellow;  
  114.     /* add a margin to the left and right side it causes the nav li to be spaced.  */
  115.     /* Why not use padding here ?     */    
  116.     margin: 0 1em;
  117. }
  118.  
  119.  
  120.  
  121.  
  122.  
  123. nav a  {
  124.  
  125.     /* removes the underline from links */ 
  126.     text-decoration: none;
  127.     color: #707070;
  128.     font-weight: 700;
  129.     /* temporary css that clarifies how the elements works */
  130.     border: 3px solid green;
  131.     /* Makes  text bigger to better align with the navbar*/
  132.     font-size: 1.35rem;
  133. }
  134.  
  135.  
  136.  
  137.  
  138. /*
  139.     hovering works with Mice.
  140.     focusing works with Keyboard. users (or users with screen readers) get the same visual feedback when.
  141.     So when I hover or focus the link changes color
  142. */
  143. nav a:hover,
  144. nav a:focus {
  145.   color: #1792d2;
  146.   border-bottom: 2px solid #1792d2;
  147. }
  148.  
  149.  
  150.  
  151. .searchform  {
  152.     /* uses flexbox and puts the word search + the search form and the search button on one horizontal line */
  153.     display: flex;  
  154. }
  155.  
  156.  
  157.  
Advertisement
Add Comment
Please, Sign In to add comment