16.09.2022, 17:35. Показов 528. Ответов 3
Дорогие гуру, сильно нужна Ваша помощь.
Есть сайт на бутстрап. Где-то видимо допустил ошибку в коде и теперь при увеличении масштаба сайта текст "Есть у тебя идея?" прячется под шапку. При нормальном компьютерном расширении всё отображается хорошо. Но вот сайт должен быть адаптивным и отображатся на любом устройстве менее более одинаково хорошо.
Даю весь код сайта (думаю так будет легче помочь. В низу ещё скрины и одно решение которое я нашел, но тогда на пк не правильно отображается картинка "космоса" и текст):
| HTML5 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
| <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 href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
<link rel="stylesheet" href="style/my.css">
<link rel="stylesheet" href="style/animate_t.css">
<title>Создание сайтов</title>
</head>
<body>
<header class="p-3 border-bottom fixed-top sticky-top">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-dark text-decoration-none">
<img src="/logo.png" style="width: 200px; height: 65px;">
</a>
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><a href="#" class="nav-link px-2 link-secondary">Overview</a></li>
<li><a href="#" class="nav-link px-2 link-dark">Inventory</a></li>
<li><a href="#" class="nav-link px-2 link-dark">Customers</a></li>
<li><a href="#" class="nav-link px-2 link-dark">Products</a></li>
</ul>
<form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3">
<input type="search" class="form-control" placeholder="Search..." aria-label="Search">
</form>
<div class="dropdown text-end">
<a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" id="dropdownUser1" data-bs-toggle="dropdown" aria-expanded="false">
<img src="https://github.com/mdo.png" alt="mdo" width="32" height="32" class="rounded-circle">
</a>
<ul class="dropdown-menu text-small" aria-labelledby="dropdownUser1">
<li><a class="dropdown-item" href="#">New project...</a></li>
<li><a class="dropdown-item" href="#">Settings</a></li>
<li><a class="dropdown-item" href="#">Profile</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Sign out</a></li>
</ul>
</div>
</div>
</div>
</header>
<section id="hero" class="d-flex align-items-center justify-content-center">
<img class="rot" src="/img/promo-st.png">
<div class="container text-center">
<div class="row justify-content-center">
<div class="col-md-6 col-lg-8">
<div class="animate one">
<h1><span>Е</span><span>С</span><span>Т</span><span>Ь</span> <span>У</span> <span>Т</span><span>Е</span><span>Б</span><span>Я</span> <span>И</span><span>Д</span><span>Е</span><span>Я</span><span>?</span></h1>
</div>
<div class="animate-2 three">
<h2>
<span>П</span><span>О</span><span>З</span><span>В</span><span>О</span><span>Л</span><span>Ь</span>
<span>Н</span><span>А</span><span>М</span> <span>В</span><span>О</span><span>П</span><span>Л</span><span>О</span><span>Т</span><span>И</span> <span>Т</span><span>Ь</span> <span>В</span> <span>Р</span><span>Е</span><span>А</span><span>Л</span><span>Ь</span><span>Н</span><span>О</span><span>С</span><span>Т</span><span>Ь</span><span>!</span>
</h2>
</div>
</div>
</div>
<div class="row mt-5 justify-content-center">
<div class="col-xl-2 col-md-4 col-6">
<div class="icon-box">
<svg xmlns="http://www.w3.org/2000/svg" width="3em" height="3em" fill="#ffc451" class="bi bi-award" viewBox="0 0 16 16">
<path d="M9.669.864 8 0 6.331.864l-1.858.282-.842 1.68-1.337 1.32L2.6 6l-.306 1.854 1.337 1.32.842 1.68 1.858.282L8 12l1.669-.864 1.858-.282.842-1.68 1.337-1.32L13.4 6l.306-1.854-1.337-1.32-.842-1.68L9.669.864zm1.196 1.193.684 1.365 1.086 1.072L12.387 6l.248 1.506-1.086 1.072-.684 1.365-1.51.229L8 10.874l-1.355-.702-1.51-.229-.684-1.365-1.086-1.072L3.614 6l-.25-1.506 1.087-1.072.684-1.365 1.51-.229L8 1.126l1.356.702 1.509.229z"/>
<path d="M4 11.794V16l4-1 4 1v-4.206l-2.018.306L8 13.126 6.018 12.1 4 11.794z"/>
</svg>
<h3><a href="/">Создание веб-сайтов</a></h3>
</div>
</div>
<div class="col-xl-2 col-md-4 col-6">
<div class="icon-box">
<svg xmlns="http://www.w3.org/2000/svg" width="3em" height="3em" fill="#ffc451" class="bi bi-award" viewBox="0 0 16 16">
<path d="M9.669.864 8 0 6.331.864l-1.858.282-.842 1.68-1.337 1.32L2.6 6l-.306 1.854 1.337 1.32.842 1.68 1.858.282L8 12l1.669-.864 1.858-.282.842-1.68 1.337-1.32L13.4 6l.306-1.854-1.337-1.32-.842-1.68L9.669.864zm1.196 1.193.684 1.365 1.086 1.072L12.387 6l.248 1.506-1.086 1.072-.684 1.365-1.51.229L8 10.874l-1.355-.702-1.51-.229-.684-1.365-1.086-1.072L3.614 6l-.25-1.506 1.087-1.072.684-1.365 1.51-.229L8 1.126l1.356.702 1.509.229z"/>
<path d="M4 11.794V16l4-1 4 1v-4.206l-2.018.306L8 13.126 6.018 12.1 4 11.794z"/>
</svg>
<h3><a href="/">Создание логотипов</a></h3>
</div>
</div>
<div class="col-xl-2 col-md-4 col-6">
<div class="icon-box">
<svg xmlns="http://www.w3.org/2000/svg" width="3em" height="3em" fill="#ffc451" class="bi bi-award" viewBox="0 0 16 16">
<path d="M9.669.864 8 0 6.331.864l-1.858.282-.842 1.68-1.337 1.32L2.6 6l-.306 1.854 1.337 1.32.842 1.68 1.858.282L8 12l1.669-.864 1.858-.282.842-1.68 1.337-1.32L13.4 6l.306-1.854-1.337-1.32-.842-1.68L9.669.864zm1.196 1.193.684 1.365 1.086 1.072L12.387 6l.248 1.506-1.086 1.072-.684 1.365-1.51.229L8 10.874l-1.355-.702-1.51-.229-.684-1.365-1.086-1.072L3.614 6l-.25-1.506 1.087-1.072.684-1.365 1.51-.229L8 1.126l1.356.702 1.509.229z"/>
<path d="M4 11.794V16l4-1 4 1v-4.206l-2.018.306L8 13.126 6.018 12.1 4 11.794z"/>
</svg>
<h3><a href="/">Продвижение веб-сайта</a></h3>
</div>
</div>
<div class="col-xl-2 col-md-4 col-6">
<div class="icon-box">
<svg xmlns="http://www.w3.org/2000/svg" width="3em" height="3em" fill="#ffc451" class="bi bi-award" viewBox="0 0 16 16">
<path d="M9.669.864 8 0 6.331.864l-1.858.282-.842 1.68-1.337 1.32L2.6 6l-.306 1.854 1.337 1.32.842 1.68 1.858.282L8 12l1.669-.864 1.858-.282.842-1.68 1.337-1.32L13.4 6l.306-1.854-1.337-1.32-.842-1.68L9.669.864zm1.196 1.193.684 1.365 1.086 1.072L12.387 6l.248 1.506-1.086 1.072-.684 1.365-1.51.229L8 10.874l-1.355-.702-1.51-.229-.684-1.365-1.086-1.072L3.614 6l-.25-1.506 1.087-1.072.684-1.365 1.51-.229L8 1.126l1.356.702 1.509.229z"/>
<path d="M4 11.794V16l4-1 4 1v-4.206l-2.018.306L8 13.126 6.018 12.1 4 11.794z"/>
</svg>
<h3><a href="/">Разработка рекламных баннеров</a></h3>
</div>
</div>
</div>
<div class="row mt-5 justify-content-center">
<div class="mouse">
<div class="wheel"> </div>
</div>
</div>
</div>
</section>
<section class="about my-5" id="about">
<div class="container">
<div class="row">
<div class="col-lg-6 order-1 order-lg-2">
<img class="img-fluid" src="https://bipbap.ru/wp-content/uploads/2017/04/0_7c779_5df17311_orig.jpg" alt="">
</div>
<div class="col-lg-6 pt-5 pt-lg-0 order-2 order-lg-1 content">
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repudiandae, exercitationem.</h3>
<p class="font-italic">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio ea, quas magnam at dolorum nobis dolor recusandae perspiciatis!</p>
<ul>
<li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#ffc451" class="bi bi-check2-all" viewBox="0 0 16 16">
<path d="M12.354 4.354a.5.5 0 0 0-.708-.708L5 10.293 1.854 7.146a.5.5 0 1 0-.708.708l3.5 3.5a.5.5 0 0 0 .708 0l7-7zm-4.208 7-.896-.897.707-.707.543.543 6.646-6.647a.5.5 0 0 1 .708.708l-7 7a.5.5 0 0 1-.708 0z"/>
<path d="m5.354 7.146.896.897-.707.707-.897-.896a.5.5 0 1 1 .708-.708z"/>
</svg> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi, voluptate! Lorem ipsum.</li>
<li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#ffc451" class="bi bi-check2-all" viewBox="0 0 16 16">
<path d="M12.354 4.354a.5.5 0 0 0-.708-.708L5 10.293 1.854 7.146a.5.5 0 1 0-.708.708l3.5 3.5a.5.5 0 0 0 .708 0l7-7zm-4.208 7-.896-.897.707-.707.543.543 6.646-6.647a.5.5 0 0 1 .708.708l-7 7a.5.5 0 0 1-.708 0z"/>
<path d="m5.354 7.146.896.897-.707.707-.897-.896a.5.5 0 1 1 .708-.708z"/>
</svg> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi, voluptate!</li>
<li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#ffc451" class="bi bi-check2-all" viewBox="0 0 16 16">
<path d="M12.354 4.354a.5.5 0 0 0-.708-.708L5 10.293 1.854 7.146a.5.5 0 1 0-.708.708l3.5 3.5a.5.5 0 0 0 .708 0l7-7zm-4.208 7-.896-.897.707-.707.543.543 6.646-6.647a.5.5 0 0 1 .708.708l-7 7a.5.5 0 0 1-.708 0z"/>
<path d="m5.354 7.146.896.897-.707.707-.897-.896a.5.5 0 1 1 .708-.708z"/>
</svg> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi, voluptate! Lorem ipsum dolor sit amet, consectetur.</li>
<li><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#ffc451" class="bi bi-check2-all" viewBox="0 0 16 16">
<path d="M12.354 4.354a.5.5 0 0 0-.708-.708L5 10.293 1.854 7.146a.5.5 0 1 0-.708.708l3.5 3.5a.5.5 0 0 0 .708 0l7-7zm-4.208 7-.896-.897.707-.707.543.543 6.646-6.647a.5.5 0 0 1 .708.708l-7 7a.5.5 0 0 1-.708 0z"/>
<path d="m5.354 7.146.896.897-.707.707-.897-.896a.5.5 0 1 1 .708-.708z"/>
</svg> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi, voluptate! Lorem ipsum dolor.</li>
</ul>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias nihil aliquam labore, error sapiente deserunt dolorum voluptas iusto inventore odio? Sapiente molestiae temporibus magni, laudantium illo labore, fuga esse ipsum.</p>
</div>
</div>
</div>
</section>
<section class="cta mb-5">
<div class="container text-center">
<h3>Call to acrion</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut natus minima laudantium accusantium, in ipsam quos officiis atque odit tenetur.</p>
<a href="#" class="cta-btn">Call to action</a>
</div>
</section>
<div id="carouselExampleDark" class="carousel carousel-dark slide" data-bs-ride="carousel">
<div class="carousel-indicators">
<button type="button" data-bs-target="#carouselExampleDark" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
<button type="button" data-bs-target="#carouselExampleDark" data-bs-slide-to="1" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#carouselExampleDark" data-bs-slide-to="2" aria-label="Slide 3"></button>
</div>
<div class="carousel-inner">
<div class="carousel-item active" data-bs-interval="2000">
<a href="#">
<img src="slide/1.jpg" class="d-block w-100" alt="">
</a>
<div class="carousel-caption d-none d-md-block">
<h5>First slide label</h5>
<p>Some representative placeholder content for the first slide.</p>
</div>
</div>
<div class="carousel-item" data-bs-interval="2000">
<a href="#">
<img src="slide/2.jpg" class="d-block w-100" alt="">
</a>
<div class="carousel-caption d-none d-md-block">
<h5>Second slide label</h5>
<p>Some representative placeholder content for the second slide.</p>
</div>
</div>
<div class="carousel-item" data-bs-interval="2000">
<a href="#">
<img src="slide/3.jpg" class="d-block w-100" alt="">
</a>
<div class="carousel-caption d-none d-md-block">
<h5>Third slide label</h5>
<p>Some representative placeholder content for the third slide.</p>
</div>
</div>
</div>
<button class="carousel-control-prev carousel-btn" type="button" data-bs-target="#carouselExampleDark" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next carousel-btn" type="button" data-bs-target="#carouselExampleDark" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-U1DAWAznBHeqEIlVSCgzq+c9gqGAJn5c/t99JyeKa9xxaYpSvHU5awsuZVVFIhvj" crossorigin="anonymous"></script>
</body>
</html> |
|
| CSS |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
| /* body {
display: flex;
flex-direction: column;
}
header {
align-self: flex-start;
}
*/
#hero {
width: 100%;
/* flex-grow: 1;*/
height: 100vh;
background: url(https://kartinkin.net/uploads/posts/2021-07/1625737695_48-kartinkin-com-p-krasivie-oboi-kosmos-krasivie-53.jpg) center no-repeat;
background-size: cover;
position: relative;
overflow: hidden;
}
#hero:before {
content: "";
/* background: url(/img/promo-st.png) center no-repeat; */
position: absolute;
bottom: 0;
top: 0;
left: 0;
right: 0;
}
img.rot {
position: absolute;
animation-name: rot;
animation-duration: 15s;
animation-iteration-count: infinite;
}
@keyframes rot {
0% {transform: scale(0.9, 0.9) translateX(-200px) translateY(-170px) rotate(15deg);}
25% {transform: scale(1, 1) translateX(0px) translateY(-170px) rotate(0deg);}
50% {transform: scale(0.9, 0.9) translateX(200px) translateY(-170px) rotate(-15deg);}
75% {transform: scale(1, 1) translateX(0px) translateY(-170px) rotate(0deg);}
100% {transform: scale(0.9, 0.9) translateX(-200px) translateY(-170px) rotate(15deg);}
}
.mouse {
margin-top: 3rem!important;
background: #000;
border: 2px solid #fff;
border-radius: 17px;
height: 50px;
width: 30px;
display: block;
z-index: 10;
}
.mouse .wheel {
position: relative;
border-radius: 4px;
background:#fff;
width: 2px;
height: 7px;
margin: auto;
}
.mouse .wheel {
-webkit-animation-name: wheel;
animation-name: wheel;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-timing-function: ease-in-out;
animation-timing-function: ease-in-out;
-webkit-animation-delay: 0s;
animation-delay: 0s;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-play-state: running;
animation-play-state: running;
}
@-webkit-keyframes wheel {
0% {
top: 3px;
opacity: 0;
}
30% {
top: 10px;
opacity: 1;
}
100% {
top: 18px;
opacity: 0;
}
}
@keyframes wheel {
0% {
top: 3px;
opacity: 0;
}
30% {
top: 10px;
opacity: 1;
}
100% {
top: 18px;
opacity: 0;
}
}
#hero .container {
position: relative;
padding top: 75px;
}
#hero h1 {
margin-top: 3rem!important;
margin: 0;
font-size: 55px;
font-weight: 700;
line-height: 64px;
color: #fff;
}
#hero h2 {
margin: 10px 0 0 0;
color: #fff;
font-size: 23px;
}
#hero .icon-box h3 {
font-weight: 700;
margin-top: 10px;
font-size: 20px;
line-height: 26px;
}
#hero .icon-box h3 a {
color: #fff;
}
#hero .icon-box h3 a:hover {
color: #ffc451;
}
.p-3 {
background: #f7f7f7;
}
.icon-box {
padding: 30px 20px;
border: 1px solid rgba(255,255,255, 0.3);
height: 100%;
text-align: center;
}
.icon-box:hover {
border-color: #ffc451;
}
.about ul li {
list-style-type: none;
}
.cta {
background: linear-gradient(rgba(2,2,2,0.5), rgba(2,2,2,0.8)), url(https://readd.org/wp-content/uploads/2020/07/photo-1572556839473-5b93f3cc2466.jpg) fixed center center;
padding: 80px 0;
color: #fff;
}
.cta h3 {
font-weight: 700;
font-size: 28px;
}
.cta-btn {
font-weight: 600;
font-size: 16px;
letter-spacing: 1px;
display: inline-block;
padding: 8px 28px;
border: 2px solid #fff;
border-radius: 4px;
color: #fff;
margin-top: 10px;
}
.cta-btn:hover {
background: #ffc451;
border-color: #ffc451;
color: #151515;
}
.carousel-btn {
background: rgba(0, 0, 0, 0.1);
} |
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Если убрать в css:
| CSS |
1
2
| #hero{
height: 100vh;} |
|
то при увеличении всё становится нормально. Но теперь на ПК главная картинка (где текст) не растягивается на весь экран.
Как можно решить эту проблему????
Скрины (для понимания) прикрепил.