質問編集履歴
2
記載内容が不適切だったため修正しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,29 +8,111 @@
|
|
8
8
|
下記ソースコードによりウィンドウの高さ変更時に横幅は親要素をはみ出さず、余白が表示されます
|
9
9
|
### 該当のソースコード
|
10
10
|
```HTML
|
11
|
-
<div id="
|
11
|
+
<div id="wrapper">
|
12
|
+
<header>
|
13
|
+
<nav>
|
14
|
+
</nav>
|
15
|
+
</header>
|
16
|
+
<div id="contents">
|
17
|
+
<div class="flex-wrap">
|
18
|
+
<div class="video-content">
|
19
|
+
<div class="video-wrap">
|
12
|
-
|
20
|
+
<div id="video-box">
|
13
|
-
|
21
|
+
<video class="video">
|
14
|
-
|
22
|
+
<source src="https://www9.nhk.or.jp/das/movie/D0002190/D0002190002_00000_V_000.mp4">
|
15
|
-
|
23
|
+
</video>
|
16
|
-
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<div class="video-footer">
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<div class="form">
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
<footer>
|
34
|
+
</footer>
|
17
35
|
</div>
|
18
36
|
```
|
19
37
|
```CSS
|
20
|
-
|
38
|
+
body, html {
|
21
|
-
|
39
|
+
height: 100%;
|
22
|
-
width: 100%;
|
23
40
|
}
|
41
|
+
|
42
|
+
#wrapper {
|
43
|
+
width: 100%;
|
44
|
+
height: 100%;
|
45
|
+
margin: 0px auto;
|
46
|
+
}
|
47
|
+
|
48
|
+
header, footer {
|
49
|
+
height: 6%;
|
50
|
+
color: white;
|
51
|
+
position: relative;
|
52
|
+
}
|
53
|
+
|
54
|
+
header {
|
55
|
+
background-color: #F00;
|
56
|
+
}
|
57
|
+
|
58
|
+
footer {
|
59
|
+
background-color: #0F0;
|
60
|
+
}
|
61
|
+
|
62
|
+
#contents {
|
63
|
+
height: 88%;
|
64
|
+
background-color: #000;
|
65
|
+
}
|
66
|
+
|
67
|
+
.flex-wrap {
|
68
|
+
display: flex;
|
69
|
+
height: 100%;
|
70
|
+
position: relative;
|
71
|
+
}
|
72
|
+
|
73
|
+
.video-content {
|
74
|
+
width: calc(100% - 350px);
|
75
|
+
height: 100%;
|
76
|
+
position: relative;
|
77
|
+
}
|
78
|
+
|
79
|
+
.video-wrap {
|
80
|
+
position: relative;
|
81
|
+
width: 100%;
|
82
|
+
height: calc(100% - 70px);
|
83
|
+
}
|
84
|
+
|
24
85
|
#video-box {
|
25
|
-
|
86
|
+
position: relative;
|
26
|
-
|
87
|
+
max-height: 100%;
|
27
|
-
|
88
|
+
max-width: 100%;
|
28
89
|
}
|
90
|
+
|
29
|
-
.video {
|
91
|
+
#video-box > .video {
|
30
|
-
|
92
|
+
position: relative;
|
31
|
-
|
93
|
+
height: 100%;
|
32
|
-
|
94
|
+
width: 100%;
|
33
95
|
}
|
96
|
+
|
97
|
+
.video-footer {
|
98
|
+
position: relative;
|
99
|
+
bottom: 0;
|
100
|
+
width: 100%;
|
101
|
+
display: flex;
|
102
|
+
height: 70px;
|
103
|
+
background-color: #00F;
|
104
|
+
}
|
105
|
+
|
106
|
+
.form {
|
107
|
+
width: 350px;
|
108
|
+
overflow: scroll;
|
109
|
+
position: absolute;
|
110
|
+
right: 0;
|
111
|
+
top: 0;
|
112
|
+
bottom: 0;
|
113
|
+
background-color: white;
|
114
|
+
border: 1px solid;
|
115
|
+
}
|
34
116
|
```
|
35
117
|
### 試したこと
|
36
118
|
・videoのheightを100vhに変更
|
1
問題点をわかりやすく変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
### 発生している問題
|
7
7
|
横幅変更時に、max-heightを指定していても動画の高さが親要素をはみ出します
|
8
|
-
下記ソースコードによりウィンドウの高さ変更時に横幅は親要素をはみ出
|
8
|
+
下記ソースコードによりウィンドウの高さ変更時に横幅は親要素をはみ出さず、余白が表示されます
|
9
9
|
### 該当のソースコード
|
10
10
|
```HTML
|
11
11
|
<div id="wrap">
|