HTML Code
| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>Welcome To Maldives</title> |
| <link rel="stylesheet" href="style.css"> |
| </head> |
| <body> |
| <div class="background"> |
| <div class="nav"> |
| <a href="#" class="logo">MALDIVES</a> |
| <ul> |
| <li><a href="#">HOME</a></li> |
| <li><a href="#">TOUR</a></li> |
| <li><a href="#">ISLANDS</a></li> |
| <li><a href="#">About</a></li> |
| <li><a href="#">More</a></li> |
| </ul> |
| </div> |
| <div class="content"> |
| <h1>WELCOME TO MALDIVES</h1> |
| <p>Improve the quality of life of the Maldivian people by optimizing, <br>environmental, and socio-cultural benefits of tourism</p> |
| <div> |
| <button type="button"><span></span>Book Now</button> |
| </div> |
| </div> |
| </div> |
| |
| </body> |
| </html> |
CSS Code
| |
| @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap'); |
| |
| *{ |
| margin: 0; |
| padding: 0; |
| font-family: 'Poppins', sans-serif; |
| } |
| |
| .background { |
| width: 100%; |
| height: 100vh; |
| background-image: linear-gradient(rgba(0,0,0,0.75),rgba(0,0,0,0.75)),url(background5.jpg); |
| background-size: cover; |
| background-position: center; |
| } |
| |
| .nav { |
| width: 85%; |
| margin: auto; |
| padding: 35px; |
| display: flex; |
| align-items: center; |
| justify-content: space-between; |
| } |
| |
| .logo { |
| font-size: 24px; |
| cursor: pointer; |
| color: #f8b71f; |
| text-decoration: none; |
| } |
| |
| .nav ul li { |
| list-style: none; |
| display: inline-block; |
| margin: 0 20px; |
| position: relative; |
| } |
| |
| .nav ul li a { |
| text-decoration: none; |
| color: #fff; |
| text-transform: uppercase; |
| } |
| |
| .nav ul li::after { |
| content: ''; |
| height: 3px; |
| width: 0; |
| background: #f8b71f; |
| position: absolute; |
| left: 0; |
| bottom: -10px; |
| transition: 0.5s; |
| } |
| |
| .nav ul li:hover::after{ |
| width: 100%; |
| } |
| |
| .content { |
| width: 100%; |
| position: absolute; |
| top: 50%; |
| transform: translateY(-50%); |
| text-align: center; |
| color: #fff; |
| } |
| |
| .content h1 { |
| font-size: 65px; |
| } |
| |
| button{ |
| box-sizing: border-box; |
| width: 200px; |
| padding: 15px 0; |
| text-align: center; |
| margin: 20px 10px; |
| border-radius: 25px; |
| font-weight: bold; |
| border: 2px solid #f8b71f; |
| background: transparent; |
| color: #fff; |
| cursor: pointer; |
| position: relative; |
| overflow: hidden; |
| } |
| |
| span { |
| background: #f8b71f; |
| height: 100%; |
| width: 0; |
| border-radius: 25px; |
| position: absolute; |
| left: 0; |
| bottom: 0; |
| z-index: -1; |
| transition: 0.5s; |
| } |
| |
| button:hover span{ |
| width: 100%; |
| } |
| button:hover{ |
| border: none; |
| } |
Comments