Busigrow : Responsive Design

HTML
<!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>BusiGrow</title> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="style.css"> </head> <body> <div class="container"> <header> <div class="top-bar"> <div class="notice"> <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eum, cupiditate.</p> </div> <div class="contact"> <div class="tel"> <a href="tel:0610101010"><i class="fa-solid fa-phone"></i> 06 10 10 10 10</a> </div> <div class="mail"> <a href="mailto:admin@elbahjaacademy.com"><i class="fa-solid fa-envelope"></i> admin@elbahjaacademy.com</a> </div> </div> </div> <nav> <div class="logo"> <h1>Busi<span>Grow</span></h1> </div> <input type="checkbox" id="mobile"> <div class="mobile-menu"> <div class="menu"> <a href="">Home</a> <a href="">Gallery</a> <a href="">Pricing</a> <a href="">About</a> <a href="">Contact</a> </div> <div class="btn-nav"> <a href="" class="btn">go premium</a> </div> </div> <label for="mobile" class="lbl-mobile"><i class="fa-solid fa-bars"></i></label> </nav> <main> <h2>Grow your business fast with</h2> <h1>Busigrow</h1> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Minus blanditiis impedit suscipit harum sed facilis.</p> <a href="" class="btn">View Services</a> </main> </header> </div> </body> </html>
CSS
* { padding: 0; margin: 0; box-sizing: border-box; } /* General Begin */ body { font-family: poppins, sans-serif; color: white; } a { text-decoration: none; color: white; } /* General END */ header { height: 100vh; min-height: 500px; background: linear-gradient(#000000AA, #000000AA), url('images/bg.jpg'); background-size: cover; } /* Top bar begin */ .top-bar { background-color: #222222; height: 40px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; padding: 0 6%; } .notice { text-align: center; } .contact { display: flex; gap: 40px; } .contact i { padding-right: 5px; color: orange; } /* top bar end */ /* nav begin */ nav { position: relative; background-color: #ececec; color: #222222; height: 80px; display: flex; justify-content: space-between; align-items: center; padding: 0 6%; } .logo { flex: 1; } .logo span { color: white; background-color: orange; } .mobile-menu { flex: 2; display: flex; justify-content: space-between; align-items: center; } #mobile, .lbl-mobile { display: none; } .lbl-mobile { cursor: pointer; } .menu { display: flex; gap: 20px; flex: 1; justify-content: center; } nav .menu a { color: #222222; transition: .5s; } nav .menu a:hover { color: orange; } .btn-nav { flex: 1; display: flex; justify-content: end; } .btn { padding: 15px 25px; background-color: orange; border-radius: 30px; font-weight: 400; transition: .5s; } .btn:hover { background-color: #222; } /* nav end */ /* main begin */ main { height: calc(100vh - 120px); min-height: 380px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px; text-align: center; padding: 25px; } main h2 { font-size: 54px; } main h1 { font-size: 70px; color: orange; text-transform: uppercase; } /* main end */ /*-------------- responsive -------------------*/ @media (max-width:1024px) { .top-bar { height: 80px; flex-direction: column; justify-content: space-evenly; } main { height: calc(100vh - 160px); } } @media (max-width:900px) { .lbl-mobile { display: block; } #mobile:checked~.mobile-menu { right: 0; } .mobile-menu { position: fixed; background-color: #ececec; top: 160px; right: -300px; width: 300px; height: calc(100vh - 160px); display: flex; flex-direction: column; justify-content: center; align-items: center; border-top: 1px solid #d6d6d6; transition: 1s; } .menu { flex-direction: column; justify-content: end; text-align: center; } .btn-nav { align-items: center; } } @media (max-width:600px) { .top-bar { font-size: 12px; } main h2 { font-size: 42px; } main h1 { font-size: 58px; } }
Author:خالد البهجة
خالد البهجة مؤسس البهجة أكاديمي يتمتع بخبرة أزيد من عشر سنوات في تدريس التصميم الجرافيكي والبرمجة. متخصص في تطوير الويب وتصميم المواقع.
جميل جدا????????????