-
Notifications
You must be signed in to change notification settings - Fork 289
/
after.html
89 lines (76 loc) · 3.18 KB
/
after.html
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
<!DOCTYPE html>
<html class="page" lang="ru">
<head>
<title>Карточка с псевдоклассом :has</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/* Page */
.page {
font-family: sans-serif;
}
.page__body {
margin: auto;
width: 500px;
display: grid;
row-gap: 20px;
}
/* News */
.news {
display: grid;
background-color: paleturquoise;
}
.news__title {
margin: 0;
padding: 15px;
font-weight: normal;
font-size: 20px;
}
.news__picture {
max-width: 100%;
order: -1;
}
.news__lead {
margin: 0;
padding: 15px;
padding-top: 0;
}
/* News Image */
.news:has(.news__picture) {
grid-template-columns: 1fr 2fr;
background-color: lightgreen;
}
.news__picture {
grid-row: span 2;
align-self: stretch;
}
/* News Shout */
.news:not(
:has(.news__picture),
:has(.news__lead)
) {
background-color: peachpuff;
}
.news:not(
:has(.news__picture),
:has(.news__lead)
) .news__title {
font-size: 25px;
}
</style>
</head>
<body class="page__body">
<article class="news">
<h3 class="news__title">В Харькове котята подкараулили хозяина за дверью. А потом навалились на него все разом</h3>
<p class="news__lead">В Харькове прошел дождь из котят: рыжих, черных и черно-белых. Малыши прятались в комнате, поэтому когда хозяин (или человек, взявший их на передержку) открыл дверь, на него с мяуканьем вывалился с десяток котят одновременно.</p>
</article>
<article class="news">
<h3 class="news__title">В Харькове котята подкараулили хозяина за дверью. А потом навалились на него все разом</h3>
<img class="news__picture" src="picture.svg" alt="">
<p class="news__lead">В Харькове прошел дождь из котят: рыжих, черных и черно-белых. Малыши прятались в комнате, поэтому когда хозяин (или человек, взявший их на передержку) открыл дверь, на него с мяуканьем вывалился с десяток котят одновременно.</p>
</article>
<article class="news">
<h3 class="news__title">В Харькове котята подкараулили хозяина за дверью. А потом навалились на него все разом</h3>
</article>
</body>
</html>