desito07

Position Playground my solution

Feb 3rd, 2022
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.51 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>Positioning Playground</title>
  7.     <link rel="stylesheet" href="styleCorrect.css">
  8. </head>
  9. <body>
  10.     <div class="viewport">
  11.         <section class="card1">
  12.             <img class="pic1" src="./images/picture1.jpg" alt="Pic1">
  13.             <i class="fas fa-link"></i>
  14.         </section>
  15.     </div>
  16.     <div class="viewport">
  17.         <section class="card2">
  18.             <img class="pic2" src="./images/picture2.jpg" alt="Pic2">
  19.             <i class="fas fa-star"></i>
  20.         </section>
  21.     </div>
  22. </body>
  23. </html>
  24. _______________________________________________________________________
  25.  
  26. @import url("https://use.fontawesome.com/releases/v5.15.4/css/all.css");
  27.  
  28. body {
  29.     margin: 0;
  30. }
  31.  
  32. section.card1 {
  33.     height: 100vh;
  34.  
  35. }
  36.  
  37. .card1 {
  38.     background: rgb(31,97,155);
  39. background: linear-gradient(90deg, rgba(31,97,155,1) 0%, rgba(74,203,163,1) 100%);
  40. }
  41.  
  42. .card2 {
  43.     background: rgb(166,54,118);
  44. background: linear-gradient(90deg, rgba(166,54,118,1) 0%, rgba(171,105,32,1) 100%);
  45. }
  46.  
  47. .pic1 {
  48.     position: relative;
  49.     left: 33%;
  50.     top: 32%;
  51. }
  52.  
  53. .pic2 {
  54.     position: relative;
  55.     left: 33%;
  56.     top: 101%;
  57.     margin-top: 40px;
  58.     margin-bottom: 30px;
  59. }
  60.  
  61. i {
  62.     color: white;
  63.  }
  64.  
  65.  .card1 i {
  66.     position: absolute;
  67.     top: 71%;
  68.     left: 63%;
  69. }
  70.  
  71. .card2 i {
  72.     position: absolute;
  73.     bottom: -99%;
  74.     left: 63%;
  75. }
  76.  
  77.  
Advertisement
Add Comment
Please, Sign In to add comment