質問編集履歴

1

コードブロックに変更し、CSSを記述しました。consoleにエラーは出ておりません。

2018/08/28 05:38

投稿

cofcof
cofcof

スコア37

test CHANGED
File without changes
test CHANGED
@@ -5,6 +5,10 @@
5
5
  htmlの内容
6
6
 
7
7
  ------------------------
8
+
9
+
10
+
11
+ ```html
8
12
 
9
13
  <header>
10
14
 
@@ -24,7 +28,7 @@
24
28
 
25
29
  以下コンテンツが入ります。
26
30
 
27
- ------------------------
31
+ ```
28
32
 
29
33
  これに対して、以下のようなjqueryを記述してみましたが、動きませんでした。
30
34
 
@@ -35,6 +39,10 @@
35
39
  scriptの内容
36
40
 
37
41
  ------------------------
42
+
43
+
44
+
45
+ ```javascript
38
46
 
39
47
  $(function(){
40
48
 
@@ -60,6 +68,82 @@
60
68
 
61
69
  });
62
70
 
71
+ ```
72
+
73
+
74
+
75
+ cssの内容
76
+
77
+ ```css
78
+
79
+ header {
80
+
81
+ height: 50px;
82
+
83
+ position: fixed;
84
+
85
+ z-index: 1000;
86
+
87
+ width: 100%;
88
+
89
+ min-width: 320px;
90
+
91
+ top: 0;
92
+
93
+ left: 0;
94
+
95
+ }
96
+
97
+ header.bback {
98
+
99
+ background: rgba(0,0,0,0.5);
100
+
101
+ }
102
+
103
+ #contents {
104
+
105
+ position:fixed;
106
+
107
+ top:0;
108
+
109
+ right:0;
110
+
111
+ bottom:0;
112
+
113
+ left:0;
114
+
115
+ min-height:100vh;
116
+
117
+ overflow-y:scroll;
118
+
119
+ width:100%;
120
+
121
+ }
122
+
123
+ #top {
124
+
125
+ background: #000;
126
+
127
+ width: 100%;
128
+
129
+ height: 100vh;
130
+
131
+ overflow: hidden;
132
+
133
+ position: relative;
134
+
135
+ }
136
+
137
+ main {
138
+
139
+ padding: 0.5rem;
140
+
141
+ min-height: calc(100vh - 300px);/*フッター固定用の指定です*/
142
+
143
+ }
144
+
145
+ ```
146
+
63
147
  ------------------------
64
148
 
65
149
  jQueryのバージョンは2.24です。