0 / 0 / 0
Регистрация: 15.01.2017
Сообщений: 31
|
|
|
|
Меню бургер пропадает под блоком
18.03.2020, 15:18. Показов 2106. Ответов 3
Сделал выпадающее меню(topnav) для адаптации при маленьких разрешениях, до 1010px, но оно пропадает при прокручивании через блок laptop. Нужно что бы оно было всегда видно при прокручивании. Пропадает в этом месте:
| 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
| <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ALEX</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style2.css">
<link rel="stylesheet" href="libs/fontawesome/all.min.css">
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> -->
</head>
<body>
<header>
<div class="header__logo"><p><img src="https://www.cyberforum.ru/images/logo.gif"></p></div>
<nav>
<div class="topnav" id="myTopnav">
<a href="#" id="menu" class="icon">☰</a>
<a href="#">HOME</a>
<a href="#">SERVICE</a>
<a href="#">ABOUT AS</a>
<a href="#">PRICING TABLE</a>
<a href="#">HOW IT WORK</a>
<a href="#">HAPPY CLIENTS</a>
<a href="#">CONTACT US</a>
</div>
</nav>
</header>
<main>
<div class="main__welcome">
<h1>Boost up your Local business</h1>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum typesetting</p>
<section class="contact__form">
<div class="contact_wrapper">
<form action="#" name="contact" class="contact_form">
<div class="contact">
<div class="input_form">
<input type="text" class="fas" placeholder=" Full Name" name="Name" class="contact_input">
</div>
<div class="input_form">
<input type="text" class="fas" placeholder=" Email Address" name="Email" class="contact_input">
</div>
<div class="input_form">
<input type="text" class="fas" placeholder=" Phone Number" name="Phone" class="contact_input">
</div>
<input type="submit" name="to send" value="REQUEST A QUOTE" class="input_buton">
</div>
</form>
</div>
</section>
</div>
<div class="laptop">
<img src="https://www.cyberforum.ru/images/laptop.png">
<section class="fotorama" data-width="460" data-height="264" data-loop="true" >
<img src="https://www.cyberforum.ru/images/1photo.png">
<img src="https://www.cyberforum.ru/images/1photo.png">
<img src="https://www.cyberforum.ru/images/1photo.png">
</section>
</div>
<div class="main__services">
<div class="wrap">
<h1>OUR SERVICE</h1>
<div class="textt">Lorem Ipsum is simply dummy Business industry.</div>
<div class="services">
<div class="services-item">
<div class="services_img"><img src="https://www.cyberforum.ru/images/1.png" vspace="20" hspace="5"></div>
<div class="service_text">
<h3>Font-Awesome Icons</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
</div>
</div>
<div class="services-item">
<div class="services_img"><img src="https://www.cyberforum.ru/images/2.png" vspace="20" hspace="5" alt=""></div>
<div class="service_text">
<h3>Fully Responsive Design</h3>
<p>Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy.</p>
</div>
</div>
<div class="services-item">
<div class="services_img"><img src="https://www.cyberforum.ru/images/3.png" vspace="20" hspace="5" alt=""></div>
<div class="service_text">
<h3>Working Contact form</h3>
<p>Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will un cover many web sites still in their infancy</p>
</div>
</div>
<div class="services-item">
<div class="services_img"><img src="https://www.cyberforum.ru/images/4.png" vspace="20" hspace="0" alt=""></div>
<div class="service_text">
<h3>Retina Ready icons here</h3>
<p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything</p>
</div>
</div>
<div class="services-item">
<div class="services_img"><img src="https://www.cyberforum.ru/images/5.png" vspace="20" hspace="0"alt=""></div>
<div class="service_text">
<h3>Friendly Code</h3>
<p>Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham</p>
</div>
</div>
<div class="services-item">
<div class="services_img"><img src="https://www.cyberforum.ru/images/6.png" vspace="20" hspace="0" alt=""></div>
<div class="service_text">
<h3>Flat trendy landing page Design</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
</div>
</div>
</div>
</div>
</div>
</main>
<script src="script.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
crossorigin="anonymous"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.js"></script>
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
| *{LiveReload: Enable/disable plugins
margin: 0;
padding: 0;
}
a{
text-decoration: none;
}
li{
list-style: none;
}
body{
font-family: 'Open Sans', sans-serif;
}
header{
width: 100%;
background: #FFF;
display: flex;
position: relative;
}
.header__logo{
text-transform: uppercase;
color: #fff;
font-weight: 800;
font-size: 24px;
cursor: pointer;
margin-left: 15%;
}
nav{
margin-top: 42px;
margin-left: 12%;
}
.topnav a{
color: #AAA;
text-align: center;
padding: 12px 15px;
font-size: 14px;
font-weight: bold;
}
.topnav a:hover{
background: #ffbb42;
border-radius: 7px 7px 7px 7px;
color: #fff;
}
.topnav .icon{
display: none;
}
main{
display: flex;
flex-direction: column;
width: 100%;
}
main .main__welcome{
background: #709dca;
text-align: center;
padding: 140px 0px 100px 0;
}
main .main__welcome h1{
color: #fff;
font-size: 35px;
font-family: 'Poppins-Bold', sans-serif;
text-transform: uppercase;
}
main .main__welcome p{
color: #fff;
font-size: 16px;
font-family: 'OpenSans-Light', sans-serif;
}
.contact{
display: flex;
justify-content: space-between;
margin-bottom: 30px;
}
.contact p,
.contact_wrapper{
width: 56%;
margin: 0 auto;
}
.contact_form{
width: 100%;
}
input{
width: 100%;
height: 40px;
}
.input_form{
/*width: 48%;*/
width: 280px;
height: 45px;
margin-right: 15px;
}
.input_buton{
height: 46px;
background-color: #ffbb42;
width: 211px;
font-size: 16px;
color: white;
}
.laptop{
display: flex;
justify-content: center;
position: relative;
bottom: 50px;
background: #709dca;
width: 100%;
height: auto;
}
.fotorama{
display: flex;
position: absolute;
top: 19px;
justify-content: center;
/*right: 100px;
bottom: 64px;*/
}
main .main__services {
/* text-align: center; */
}
main .main__services h1{
text-align: center;
color: #394b50;
font-size: 30px;
font-family: 'Gotham', sans-serif;
text-transform: uppercase;
letter-spacing: -0.75px;
}
.textt {
color: #394b50;
text-align: center;
font-size: 16px;
font-family: 'OpenSans-Light', sans-serif;
}
.main__services{
padding-bottom: 40px;
}
.wrap{
width: 100%;
max-width: 1167px;
margin: 0 auto;
padding-left: 15px;
padding-right: 15px;
}
.services{
display: grid;
grid-template: 50% 50% / 50% 50%;
padding-top: 50px;
}
.service-item{
display: flex;
justify-content: flex-start;
align-items: left;
width: 550px;
}
.services_img{
display: flex;
width: 80px;
float:left;
padding-right: 10px;
padding-bottom: 55px;
}
.services h3{
color: #394b50;
font-family: Lato;
font-size: 16px;
text-transform: uppercase;
font-weight: 700;
}
.services p{
/* Style for "Lorem Ipsu" */
max-width: 427px;
height: 57px;
color: #7b7b7b;
font-family: "Open Sans";
font-size: 13px;
text-align: left;
}
@media screen and (max-width: 1800px) {
nav{
margin-left: 25%;
}
}
@media screen and (max-width: 1400px) {
nav{
margin-left: 10%;
}
}
@media screen and (max-width: 1200px) {
nav{
margin-left: 7%;
}
}
@media screen and (max-width: 1105px) {
nav{
margin-left: 0.5%;
}
}
@media screen and (max-width: 1010px){
.topnav a{
display: none;
}
.topnav a.icon{
float: right;
display: block;
color: #AAA;
font-size: 25px;
}
nav{
width: 97%;
position: fixed;
top:-1px;
}
.topnav.responsive{
position: fixed;
top: 42px;
right: 1px;
}
header .topnav.responsive{
height: 360px;
background: #329FFF;
border-radius: 3px;
opacity: .8;
}
.topnav.responsive a{
float: none;
display: block;
text-align: left;
color: #fff;
/*border-style: solid;*/
}
.topnav.responsive a:hover{
color: black;
}
} |
|
| JavaScript | 1
2
3
4
5
6
7
8
9
| menu.onclick=function myFunction() {
var x=document.getElementById('myTopnav');
if (x.className ==="topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
} |
|
0
|