teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

内容追加

2016/12/09 03:37

投稿

-1an.vvks-
-1an.vvks-

スコア71

title CHANGED
File without changes
body CHANGED
@@ -18,4 +18,212 @@
18
18
 
19
19
  としてみましたが、回転します。
20
20
 
21
- animation:none;も効きませんでした。
21
+ animation:none;も効きませんでした。
22
+
23
+ ###詳細
24
+ ヘッダの左端の丸(<a id="siteLogo" href="../index.html"></a>)にアイコン画像が入ります。
25
+ ```html
26
+ <!DOCTYPE html>
27
+
28
+ <html lang="ja">
29
+
30
+ <head>
31
+ <meta charset="utf-8">
32
+ <meta name="format-detection" content="telephone=no">
33
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
34
+ <title id="title">おすすめ映画 BEST 10 | ENJOY CINEMAS!</title>
35
+ <link rel="stylesheet" href="rank.css">
36
+ </head>
37
+
38
+ <body>
39
+
40
+ <header>
41
+ <input id="menuButtonInput" type="checkbox"></input>
42
+ <label id="menuButton" for="menuButtonInput"></label>
43
+ <ul id="menuItemContainer">
44
+ <li><a href="../aboutMe.html">About</a></li>
45
+ <li><a href="../index.html#topViewArticleContainer">Article</a></li>
46
+ <li><a href="../copyRight.html">Copyright</a></li>
47
+ </ul>
48
+ <a id="siteLogo" href="../index.html"></a>
49
+ </header>
50
+
51
+ <article id="movieInfoContainer">
52
+
53
+ <!--省略-->
54
+
55
+ </article>
56
+
57
+ </body>
58
+
59
+ </html>
60
+ ```
61
+
62
+ ```css
63
+ *{padding:0;margin:0;box-sizing:border-box;}
64
+ html,body{
65
+ position:relative;
66
+ top:0;
67
+ overflow-x:hidden;
68
+ width:100vw;
69
+ font-size:17px;
70
+ -webkit-text-size-adjust:100%;
71
+ }
72
+
73
+ body{background:#eee;font-family:sans-serif;}
74
+
75
+ a:link,a:visited{text-decoration:none;}
76
+ ul> li{list-style-type:none;}
77
+
78
+ header{
79
+ position:fixed;
80
+ top:0;left:0;
81
+ z-index:3;
82
+ transition:0.5s;
83
+ width:100vw;
84
+ height:10vh;
85
+ text-align:right;
86
+ background:#333;
87
+ }
88
+ /*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
89
+ #siteLogo{
90
+ display:inline-block;
91
+ position:absolute;
92
+ top:0.5vh;
93
+ left:0.5vh;
94
+ width:9vh;
95
+ height:9vh;
96
+ background: url("../img/enjoyCinemasIcon.png") 0 0 / contain;
97
+ border-radius:9vh;
98
+ }
99
+ #siteLogo:hover{
100
+ animation: myspin 0.7s linear infinite;
101
+ }
102
+ @keyframes myspin {
103
+ 0%{transform:rotate(0deg);}
104
+ 100%{transform:rotate(360deg);}
105
+ }
106
+ /*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
107
+
108
+ #menuButtonInput,
109
+ #menuButton{display:none;z-index:1;}
110
+
111
+ #menuItemContainer{
112
+ display:inline-block;
113
+ overflow:hidden;
114
+ width:70vw;
115
+ height:10vh;
116
+ text-align:right;
117
+ padding-right:10vh;
118
+ }
119
+
120
+ #menuItemContainer >li{
121
+ display:inline-block;
122
+ height:10vh;
123
+ color:#fff;
124
+ font-size:calc(10vh / 3);
125
+ padding:calc(10vh / 3) 0;
126
+ }
127
+
128
+ #menuItemContainer >li >a{
129
+ position:relative;
130
+ transition:0.5s;
131
+ font-size:calc(10vh / 3);
132
+ height:10vh;
133
+ padding:0 3vh;
134
+ }
135
+ #menuItemContainer >li >a::after{
136
+ content:"";
137
+ display:inline-block;
138
+ position:absolute;
139
+ top:4vh;
140
+ left:50%;
141
+ transition-duration:0.5s;
142
+ width:0;
143
+ height:2px;
144
+ background:rgba(255,255,255,0.5);
145
+ }
146
+ #menuItemContainer >li >a:link,
147
+ #menuItemContainer >li >a:visited{color:white;}
148
+ #menuItemContainer >li >a:hover::after{left:0;width:100%;}
149
+
150
+ #movieInfoContainer{
151
+ font-size:17px;/*:::base-font-size:::*/
152
+ margin:100vh 15vw 5vw 15vw;
153
+ padding:5vw;
154
+ background:#fff;
155
+ }
156
+
157
+
158
+ @media screen and (max-width:80vh) {
159
+
160
+ /*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
161
+ #siteLogo{
162
+ display:inline-block;
163
+ width:15vh;
164
+ height:15vh;
165
+ border-radius:15vh;
166
+ border:2px solid #555;
167
+ margin:0.5vh;
168
+ }
169
+ #siteLogo:hover{
170
+ border:5px solid #777;
171
+ box-shadow:0 0 2px 3px #aaa;
172
+ transition:0.1s;animation-name:myspin; /*最初にanimation-name:none;を試すも効かず*/
173
+ }
174
+ @keyframes myspin{
175
+ 0%{transform:rotate(0deg);}
176
+ 100%{transform:rotate(0deg);}
177
+ }
178
+ /*■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■*/
179
+
180
+ #menuButton{
181
+ display:inline-block;
182
+ position:relative;
183
+ width:10vh;height:10vh;
184
+ }
185
+ #menuButton::before{
186
+ content:"";
187
+ display:inline-block;
188
+ position:absolute;
189
+ top:1.25vh;
190
+ left:1vh;
191
+ width:8vh;
192
+ height:1.5vh;
193
+ background:#fff;
194
+ border-radius:0.5vh;
195
+ box-shadow: 0 3vh #fff, 0 6vh #fff;
196
+ }
197
+
198
+ #menuButtonInput:checked ~ #menuItemContainer{height:90vh;padding-top:10vh;}
199
+
200
+ #menuItemContainer{
201
+ position:absolute;
202
+ top:10vh;
203
+ left:0;
204
+ transition:0.5s;
205
+ width:100vw;
206
+ height:0;
207
+ background:rgba(0,0,0,0.65);
208
+ }
209
+ #menuItemContainer > li >a{
210
+ display:inline-block;
211
+ width:80vw;
212
+ height:3em;
213
+ text-align:center;
214
+ background:#444;
215
+ border-radius:0.5vh;
216
+ border-top:3px solid #666;
217
+ border-bottom:3px solid #666;
218
+ margin:5vh 8vw 5vh 12vw;
219
+ padding:1em;
220
+ }
221
+ #menuItemContainer > li >a::after{top:0;height:9vh;}
222
+
223
+ #movieInfoContainer{
224
+ font-size:24px;/*:::base-font-size:::*/
225
+ margin:calc(90vh + 5vw) 5vw 5vw 5vw;
226
+ }
227
+ }
228
+
229
+ ```