Я начал изучать HTML и CSS, решил сделать первый проэкт, и тут такая запара.
Кликните здесь для просмотра всего текста
https://yadi.sk/i/8K1TU-_9fTkESQ - это в мазиле и тут норм
https://yadi.sk/i/1zMbd_P6PCu9Kg а это в гугле и тут какая-то дичь
HTML
Кликните здесь для просмотра всего текста
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
| <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TestProject</title>
<link rel="stylesheet" href="css/style.css">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
<SCRIPT type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></SCRIPT>
<script type="text/javascript" src="js/popup_img.js"></script>
</head>
<body>
<header>
<div class="logo">
<a href="index.html"><img class="graficlogo" src="img/logo.png" alt="Logo"></a>
</div>
<nav>
<div class="topnav" id="myTopnav">
<a href="index.html">HOME</a>
<a href="projects.html">PROJECTS</a>
<a href="blog.html">BLOG</a>
<a href="contact.html">CONTACT</a>
<a href="about.html">ABOUT</a>
<a href="services.html">SERVICES</a>
<a href="location.html">LOCATION</a>
<a id="menu" href="#" class="icon">☰</a>
</div>
</nav>
<content>
<div class="gradient">
<a><h2><b>↓GRADIENTS↓</b></h2></a>
</div>
<div class="thumbs">
<img href="img/thumb1.jpg" src="img/thumb1.jpg" alt="" class="thumb">
<img href="img/thumb2.jpg" src="img/thumb2.jpg" alt="" class="thumb">
<img href="img/thumb3.jpg" src="img/thumb3.jpg" alt="" class="thumb">
<img href="img/thumb4.jpg" src="img/thumb4.jpg" alt="" class="thumb">
</div>
</content>
</header>
<div class="inform">
<a ><img class="graficlogo" src="img/info.png" alt="info"></a>
</div>
<div class="clear"></div>
<script src="js/script.js" type="text/javascript"></script>
</body>
</html> |
|
CSS
Кликните здесь для просмотра всего текста
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
| * {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
}
li {
text-decoration: none;
list-style: none;
}
body {
font-family: 'Raleway', sans-serif;
}
.logo {
background: #000000;
width: 100%;
display: flex;
justify-content: center;
}
.graficlogo {
max-width: 100%;
box-sizing: border-box;
}
nav {
margin: auto;
width: 800px;
}
.topnav {
background-color: #fff;
font-size: 14px;
margin-top: 40px;
}
.topnav a {
color: #000;
text-align: center;
padding: 14px 16px;
font-size: 15px;
}
.topnav a:hover {
border-bottom: 1px solid #000;
}
.topnav .icon {
display: none;
}
.clear{
clear: both;
}
@media screen and (max-width: 768px) {
.topnav a:not(:first-child) {
display: none;
}
.topnav a.icon {
float: right;
margin-top: -17px;
display: block;
color: black;
}
nav {
width: 100%;
height: 100%;
}
.topnav.responsive {
position: relative;
}
.topnav.responsive a.icon {
position: absolute;
right: 0;
top: 0;
}
.topnav.responsive a {
float: none;
display: block;
text-align: left;
}
}
.gradient{
margin-top: 20px;
width: auto;
display: flex;
justify-content: center;
}
.thumbs {
width: auto;
display: flex;
justify-content: center;
max-height: 20%;
}
.thumbs IMG {
margin-right: 1%;
margin-left: 1%;
margin-top: 20px;
max-width: 20%;
max-height: 20%;
}
.thumbs:hover .thumb {
transform: scale(0.9);
}
.thumb {
background: #000;
padding: 5px;
transition: 1s;
float:left;
cursor:pointer;
-webkit
}
.thumb:hover {
transform: scale(1.1) !important;
}
.inform {
background: #000000;
width: 100%;
display: flex;
bottom: 0px;
position: absolute;
position:fixed;
justify-content: center;
}
.popup {
position: absolute;
height:100%;
width:100%;
top:0;
left:0;
display:none;
text-align:center;
}
.popup_bg {
background:rgba(0,0,0,0.4);
position:absolute;
z-index:1;
height:100%;
width:100%;
}
.popup_img {
position: relative;
margin:0 auto;
z-index:2;
max-height:94%;
max-width:94%;
margin:1% 0 0 0;
}
.popup_img {
pointer-events: none;
} |
|
JS
Кликните здесь для просмотра всего текста
Javascript |
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
| $(document).ready(function() { // Ждём загрузки страницы
$(".thumb").click(function(){ // Событие клика на маленькое изображение
var img = $(this); // Получаем изображение, на которое кликнули
var src = img.attr('src'); // Достаем из этого изображения путь до картинки
$("body").append("<div class='popup'>"+ //Добавляем в тело документа разметку всплывающего окна
"<div class='popup_bg'></div>"+ // Блок, который будет служить фоном затемненным
"<img src='"+src+"' class='popup_img' />"+ // Само увеличенное фото
"</div>");
$(".popup").fadeIn(800); // Медленно выводим изображение
$(".popup_bg").click(function(){ // Событие клика на затемненный фон
$(".popup").fadeOut(800); // Медленно убираем всплывающее окно
setTimeout(function() { // Выставляем таймер
$(".popup").remove(); // Удаляем разметку всплывающего окна
}, 800);
});
});
});
$(document).ready(function() {
$(".thumb").click(function(){ // Событие клика на маленькое изображение
var img = $(this); // Получаем изображение, на которое кликнули
var src = img.attr('src'); // Достаем из этого изображения путь до картинки
$("body").append(""+ //Добавляем в тело документа разметку всплывающего окна
""+ // Блок, который будет служить фоном затемненным
""+ // Само увеличенное фото
"");
$(".popup").fadeIn(500);
$(".popup_bg").click(function(){
$(".popup").fadeOut(500);
setTimeout(function() {
$(".popup").remove();
}, 500);
});
$(".popup").click(function(){
$(".popup").fadeOut(500);
setTimeout(function() {
$(".popup").remove();
}, 500);
});
});
}); |
|
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";
}
} |
|
ps закинул на хостинг d3f4u17.000webhostapp.com мб поможет