Advertisement
Lio-code

08 - CSS : Flexbox

Mar 11th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.66 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.  
  6. <title>FindThePrecious</title>
  7.  
  8. <meta charset="UTF-8">
  9.  
  10. <meta name="author" content="Lionel">
  11.  
  12. <meta name="description"
  13. content="A website to look for a bunch of fellows">
  14.  
  15. <meta name="viewport"
  16. content="width=device-width, initial-scale=1.0">
  17.  
  18. <link rel="stylesheet" href="style.css">
  19. </head>
  20.  
  21. <body>
  22.  
  23. <nav>
  24. <ul id=nav_ul>
  25. <li>FindThePrecious.com</li>
  26. <li>Fellows</li>
  27. <li>Contact us</li>
  28. </ul>
  29. </nav>
  30. <section>
  31. <div class="carousel"></div>
  32. </section>
  33. <section>
  34. <h2 class=fellows>Fellows wanted dead (or alive
  35. if you want to eat them later)</h2>
  36. </section>
  37.  
  38. <section class=art>
  39. <article></article>
  40. <article></article>
  41. <article></article>
  42. </section>
  43.  
  44. <hr>
  45.  
  46.  
  47. <form>
  48. <h2 class=contactus>Contact us</h2>
  49. <input type="email" placeholder="@">
  50. <input type="text" placeholder="&#8962;">
  51. <input type="text"
  52. placeholder="I have seen one of them">
  53. <textarea placeholder="Your message"></textarea>
  54. <p class=right> <button type="submit">Send
  55. !</button> </p>
  56. </form>
  57.  
  58. <footer>
  59. <div>
  60. <p>About us</p>
  61. <p>Fellow</p>
  62. <p>Join our army</p>
  63. </div>
  64.  
  65. <div>
  66. <p>FAQ</p>
  67. <p>Reward conditions</p>
  68. <p>Legal mentions</p>
  69. </div>
  70.  
  71. <div>
  72. <p>Sauron4ever.com</p>
  73. <p>Follow him also on twitter</p>
  74. </div>
  75. </footer>
  76.  
  77.  
  78. </body>
  79.  
  80. </html>
  81.  
  82. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  83.  
  84. html{
  85. height: 100%;
  86. }
  87.  
  88.  
  89. body {
  90. text-align: center;
  91. min-height: 100%;
  92. display: flex;
  93. flex-direction: column;
  94.  
  95. /* min-height: 100%;
  96. display: flex;
  97. flex-direction: column;
  98.  
  99. = force the body to adopt 100% of the viewport otherwise it will take the height of the content + height:100% sur HTML + margin-top: auto; sur footer*/
  100. }
  101.  
  102.  
  103. nav{
  104. height: 40px;
  105. background-color:#3a3a3a;
  106. }
  107.  
  108. #nav_ul {
  109. display: flex;
  110. margin: 0;
  111. }
  112.  
  113.  
  114. li {
  115. padding-right: 40px;
  116. padding-top: 10px;
  117. color: white;
  118. list-style: none;
  119. }
  120.  
  121. .carousel {
  122. background-color:lightgrey;
  123. height: 150px;
  124. width: 100%;
  125. }
  126.  
  127. h2 {font-size: 18px;}
  128.  
  129.  
  130. input, textarea{
  131. width: 80%;
  132. margin: 0 auto;
  133. display: block;
  134. margin-top: 10px;
  135. }
  136.  
  137. .contactus {
  138. display: flex;
  139. justify-content:flex-start;
  140. }
  141.  
  142. .right {
  143. display: flex;
  144. justify-content: flex-end;
  145. }
  146.  
  147. .fellows {
  148. display: flex;
  149. justify-content: center;
  150. }
  151.  
  152. .container {
  153. display: flex;
  154. flex-direction: row;
  155. justify-content: space-between;
  156. }
  157.  
  158.  
  159. article{
  160. width: 20vw;
  161. height: 10vw;
  162. background:lightgrey;
  163. }
  164.  
  165. .art {
  166. display:flex;
  167. flex-direction:row;
  168. justify-content: space-around;
  169. align-items: center;
  170. }
  171.  
  172. input, textarea{
  173. width: 80%;
  174. margin: 0 auto;
  175. display: block;
  176. margin-top: 10px;
  177. }
  178.  
  179. footer{
  180. display: flex;
  181. flex-direction: row;
  182. justify-content: space-around;
  183. color: white;
  184. background-color:#3a3a3a;
  185. margin-top: auto;
  186.  
  187. }
  188.  
  189. @media (max-width:961px) {
  190. .contactus{justify-content: center;}
  191. .art {flex-direction: column;}
  192. article {width: 30vw; height: 20vw; margin-bottom: 6vw;}
  193. footer {flex-direction: column;}
  194. .container{flex-direction: column;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement