Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Positioning Playground</title>
- <link rel="stylesheet" href="styleCorrect.css">
- </head>
- <body>
- <div class="viewport">
- <section class="card1">
- <img class="pic1" src="./images/picture1.jpg" alt="Pic1">
- <i class="fas fa-link"></i>
- </section>
- </div>
- <div class="viewport">
- <section class="card2">
- <img class="pic2" src="./images/picture2.jpg" alt="Pic2">
- <i class="fas fa-star"></i>
- </section>
- </div>
- </body>
- </html>
- _______________________________________________________________________
- @import url("https://use.fontawesome.com/releases/v5.15.4/css/all.css");
- body {
- margin: 0;
- }
- section.card1 {
- height: 100vh;
- }
- .card1 {
- background: rgb(31,97,155);
- background: linear-gradient(90deg, rgba(31,97,155,1) 0%, rgba(74,203,163,1) 100%);
- }
- .card2 {
- background: rgb(166,54,118);
- background: linear-gradient(90deg, rgba(166,54,118,1) 0%, rgba(171,105,32,1) 100%);
- }
- .pic1 {
- position: relative;
- left: 33%;
- top: 32%;
- }
- .pic2 {
- position: relative;
- left: 33%;
- top: 101%;
- margin-top: 40px;
- margin-bottom: 30px;
- }
- i {
- color: white;
- }
- .card1 i {
- position: absolute;
- top: 71%;
- left: 63%;
- }
- .card2 i {
- position: absolute;
- bottom: -99%;
- left: 63%;
- }
Advertisement
Add Comment
Please, Sign In to add comment