質問編集履歴
1
内容の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,2 +1,110 @@
|
|
1
1
|
z-indexを例えば10に指定すると、その要素はfloatと同じく浮いていることになるのでしょうか。
|
2
|
-
浮いているとしたら、floatと同じようにclearプロパティやclearfixの技法で直すことはできるのでしょうか。
|
2
|
+
浮いているとしたら、floatと同じようにclearプロパティやclearfixの技法で直すことはできるのでしょうか。
|
3
|
+
ある要素にposition:fixedとz-index:10を指定すると、その下の要素が上の要素に潜り込み重なってしまいます。下の要素のmargin-topを75pxに指定してレイアウトを整える以外に解決法はあるのでしょうか。
|
4
|
+
```HTML
|
5
|
+
<html lang="ja">
|
6
|
+
<head>
|
7
|
+
<meta charset="UTF-8">
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
9
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
10
|
+
<title>Document</title>
|
11
|
+
<link rel="stylesheet" href="stylesheet.css">
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<header>
|
15
|
+
<div class="container">
|
16
|
+
<div class="header-left">
|
17
|
+
<img src="images/isaralogo.png" alt="isara" class="header-logo">
|
18
|
+
<p class="h1">バンコクのノマドエンジニア育成講座</p>
|
19
|
+
</div>
|
20
|
+
<div class="header-right">
|
21
|
+
<a href="#">お問い合わせ / 資料請求はこちら</a>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</header>
|
25
|
+
<div id="wrap">
|
26
|
+
<section class="top">
|
27
|
+
<p class="text1">プログラミングで</p>
|
28
|
+
<p class="text1">人生の安定を手にいれよう</p>
|
29
|
+
<img src="images/isaralogolarge.png" alt="isara">
|
30
|
+
<p class="text2">バンコクのノマドエンジニア育成講座</p>
|
31
|
+
<p class="text2">iSara[イサラ]</p>
|
32
|
+
</section>
|
33
|
+
|
34
|
+
</div>
|
35
|
+
</body>
|
36
|
+
</html>
|
37
|
+
```
|
38
|
+
```CSS
|
39
|
+
@charset "utf-8";
|
40
|
+
|
41
|
+
* {
|
42
|
+
box-sizing: border-box;
|
43
|
+
text-decoration: none;
|
44
|
+
}
|
45
|
+
body {
|
46
|
+
margin:0;
|
47
|
+
}
|
48
|
+
header {
|
49
|
+
height:75px;
|
50
|
+
width:100%;
|
51
|
+
background-color:white;
|
52
|
+
position:fixed;
|
53
|
+
top:0px;
|
54
|
+
}
|
55
|
+
header:after {
|
56
|
+
content:"";
|
57
|
+
display:block;
|
58
|
+
clear:both;
|
59
|
+
}
|
60
|
+
.container {
|
61
|
+
width:1170px;
|
62
|
+
height:75px;
|
63
|
+
margin:0 auto;
|
64
|
+
}
|
65
|
+
.header-left {
|
66
|
+
float:left;
|
67
|
+
width:400px;
|
68
|
+
height:75px;
|
69
|
+
}
|
70
|
+
.header-logo {
|
71
|
+
margin-top:17px;
|
72
|
+
width:120px;
|
73
|
+
float:left;
|
74
|
+
}
|
75
|
+
.header-left .h1 {
|
76
|
+
margin: 37px 0 0 0;
|
77
|
+
font-size: 14px;
|
78
|
+
color: #333333;
|
79
|
+
font-weight:600;
|
80
|
+
letter-spacing: 2px;
|
81
|
+
}
|
82
|
+
.header-right {
|
83
|
+
float:right;
|
84
|
+
width:320px;
|
85
|
+
height:45px;
|
86
|
+
margin-top:15px;
|
87
|
+
background-color: #da6b64;
|
88
|
+
border-radius:25px;
|
89
|
+
}
|
90
|
+
.header-right a {
|
91
|
+
line-height: 45px;
|
92
|
+
font-weight:300;
|
93
|
+
font-size: 14px;
|
94
|
+
text-align:center;
|
95
|
+
color:white;
|
96
|
+
letter-spacing: 2px;
|
97
|
+
display:block;
|
98
|
+
}
|
99
|
+
.header-right:hover {
|
100
|
+
background-color:#dc143c;
|
101
|
+
}
|
102
|
+
#wrap {
|
103
|
+
margin-top:75px;
|
104
|
+
}
|
105
|
+
.top {
|
106
|
+
width:1170px;
|
107
|
+
margin:0 auto;
|
108
|
+
}
|
109
|
+
|
110
|
+
```
|