Я довольно новичок в html css и начал создавать целевую страницу, которую я получил из задач переднего наставника, показанных ниже. Так что на рабочем столе это выглядит хорошо.
Скоро появится целевая страница
Однако у меня возникают проблемы с адаптацией. Я попытался изменить столбцы шаблона сетки на строки, но это просто не сработало. Почему это?
Вот мой код
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/style.css">
<title>Document</title>
</head>
<body>
<nav class="top-img">
<div class="container">
<img src="./images/logo.svg" class="navbar-brand" alt="#">
</div>
</nav>
<!-- Section hero-->
<section id="hero">
<div class="grid">
<div class="hero-text">
<h1>We're<span> Coming Soon</span></h1>
<p>Hello fellow shoppers! We're currently building our new fashion store. Add your email below to stay up-to-date with announcements and or launch deals.</p>
<div class="icons">
<i class="fas fa-chevron-right"></i>
<input type="text" placeholder="Email Address">
</div>
</div>
<div class="hero-img">
<img src="./images/hero-desktop.jpg" alt="#">
</div>
</div>
</section>
<script src="https://kit.fontawesome.com/732aafddc7.js" crossorigin="anonymous"></script>
</body>
</html>
@import url('https://fonts.googleapis.com/css?family=Josefin+Sans:300,400,600&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
/* primary */
--desaturated-color: hsl(0, 36%, 70%);
--soft-red: hsl(0, 93%, 68%);
/*neutral*/
--dark-red: hsl(0, 6%, 24%);
/* font size - body: 16px */
--body-font: 16px;
}
.container {
/*max-width: 1200px;*/
padding: 2rem 3rem;
}
#hero {
background: url(../images/bg-pattern-desktop.svg) no-repeat center center/cover;
height: 100vh;
position: relative;
overflow: auto;
}
.navbar-brand {
padding-left: 3rem;
}
.hero-text {
width: 60%;
display: block;
padding-top: 3rem;
margin-top: 10rem;
margin-left: 6rem;
}
.hero-text h1 {
text-transform: uppercase;
color: var(--desaturated-color);
font-size: 3.5rem;
font-family: 'Josefin Sans', sans-serif;
font-weight: 300;
letter-spacing: 20px;
margin-bottom: 1.5rem;
}
.hero-text p {
font-size: var(--body-font);
color: var(--desaturated-color);
margin-bottom: 2rem;
line-height: 2;
}
.hero-text span {
color: var(--dark-red);
font-weight: 600;
}
.top-img {
position: absolute;
z-index: 1;
}
.hero-img img {
width: 100%;
height: 100vh;
}
.grid {
display: grid;
grid-template-columns: 3fr 2fr;
}
input[type=text] {
width: 100%;
padding: 1rem;
border-radius: 25px;
border: 1px solid var(--desaturated-color);
border-color: var(--desaturated-color);
}
::placeholder {
color: var(--desaturated-color);
}
.icons {
position: relative;
}
.icons i {
position: absolute;
top: 1px;
right: 0px;
color: #fff;
background: linear-gradient(135deg, hsl(0, 80%, 86%), hsl(0, 74%, 74%));
padding: 0.5rem 3rem;
height: 100%;
font-size: 1.5rem;
border-radius: 25px;
display: flex;
align-items: center;
}
@media (max-width: 768px) {
.grid {
grid-template-rows: 3fr 2fr;
}
}