質問編集履歴
1
コードを追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -3,3 +3,205 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
![イメージ画像](4d64a323628613b5857a262dc8a06d93.png)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
追記
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
```html
|
16
|
+
|
17
|
+
(省略)
|
18
|
+
|
19
|
+
<body>
|
20
|
+
|
21
|
+
<main>
|
22
|
+
|
23
|
+
<div class="margin-box left"></div>
|
24
|
+
|
25
|
+
<div class="flex">
|
26
|
+
|
27
|
+
<section class="content">
|
28
|
+
|
29
|
+
<h2>test</h2>
|
30
|
+
|
31
|
+
<p>testtesttest</p>
|
32
|
+
|
33
|
+
</section>
|
34
|
+
|
35
|
+
<div class="diagonal"></div>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
|
39
|
+
</main>
|
40
|
+
|
41
|
+
</body>
|
42
|
+
|
43
|
+
</html>
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
```
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
```css
|
52
|
+
|
53
|
+
*{
|
54
|
+
|
55
|
+
margin: 0;
|
56
|
+
|
57
|
+
padding: 0;
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
.flex{
|
64
|
+
|
65
|
+
display: flex;
|
66
|
+
|
67
|
+
align-items: flex-start;
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
body{
|
74
|
+
|
75
|
+
background-color: black;
|
76
|
+
|
77
|
+
color: white;
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
main{
|
84
|
+
|
85
|
+
max-width: 1280px;
|
86
|
+
|
87
|
+
margin: 0 auto;
|
88
|
+
|
89
|
+
padding-left: 10%;
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
.margin-box{
|
96
|
+
|
97
|
+
height: 300px;
|
98
|
+
|
99
|
+
margin-bottom: -20px;
|
100
|
+
|
101
|
+
}
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
.left{
|
106
|
+
|
107
|
+
border-left: 3px solid #FFF;
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
.content{
|
114
|
+
|
115
|
+
width: 60%;
|
116
|
+
|
117
|
+
overflow: hidden;
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
h2 {
|
124
|
+
|
125
|
+
position: relative;
|
126
|
+
|
127
|
+
display: inline-block;
|
128
|
+
|
129
|
+
padding: 0 50%;
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
h2:before,h2:after{
|
136
|
+
|
137
|
+
content: '';
|
138
|
+
|
139
|
+
position: absolute;
|
140
|
+
|
141
|
+
top: 50%;
|
142
|
+
|
143
|
+
display: inline-block;
|
144
|
+
|
145
|
+
width: 40%;
|
146
|
+
|
147
|
+
height: 3px;
|
148
|
+
|
149
|
+
background-color: white;
|
150
|
+
|
151
|
+
}
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
h2:before {
|
158
|
+
|
159
|
+
left:0;
|
160
|
+
|
161
|
+
}
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
h2:after {
|
166
|
+
|
167
|
+
right: 0;
|
168
|
+
|
169
|
+
}
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
.diagonal {
|
174
|
+
|
175
|
+
content: '';
|
176
|
+
|
177
|
+
display: inline-block;
|
178
|
+
|
179
|
+
height: 3px;
|
180
|
+
|
181
|
+
width: 40%;
|
182
|
+
|
183
|
+
background-color: white;
|
184
|
+
|
185
|
+
transform: skewY(45deg);
|
186
|
+
|
187
|
+
margin-top: 19.7vw;
|
188
|
+
|
189
|
+
}
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
.diagonal > * {
|
194
|
+
|
195
|
+
transform: skewY(-45deg);
|
196
|
+
|
197
|
+
}
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
```
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
全く実現できていませんが現時点でのコードはこんな感じです.
|
206
|
+
|
207
|
+
課題としては,横幅の変化によって斜め線の位置がずれてしまうことです.
|