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

回答編集履歴

1

質問者さんの条件追加による追記

2018/10/06 01:44

投稿

hectopascal1013
hectopascal1013

スコア466

answer CHANGED
@@ -81,4 +81,84 @@
81
81
 
82
82
  </body>
83
83
  </html>
84
+ ```
85
+
86
+ footer fixed版(+アルファでright-content 右寄せ版)
87
+ ```
88
+ <!DOCTYPE html>
89
+ <html lang="ja" class="">
90
+ <head>
91
+ <meta charset="UTF-8">
92
+ <title>Document</title>
93
+ <link rel="stylesheet" href="sample.css">
94
+ </head>
95
+ <body>
96
+ <header>header
97
+ </header>
98
+ <div class="contents">
99
+ <div class="left-content">left</div>
100
+ <div class="right-content">right</div>
101
+ <div class="bottom-content">bottom</div>
102
+ </div>
103
+
104
+ <footer>footer
105
+ </footer>
106
+
107
+
108
+ <style>
109
+ html, body{
110
+ display: ;
111
+ height: 100%;
112
+ width:100%;
113
+ margin: 0;
114
+ padding: 0;
115
+ }
116
+ header{
117
+ position:fixed ;
118
+ background-color: gray;
119
+ height: 70px;
120
+ width: 100%;
121
+ min-width: 960px;
122
+ }
123
+ .contents{
124
+ width: 960px;
125
+ background-color: #eee;
126
+ margin:0 auto;
127
+
128
+ }
129
+ .left-content{
130
+ padding:70px 0 0 0;
131
+ background-color: red;
132
+ width: 700px;
133
+ height: 400px;
134
+ float: left;
135
+ }
136
+ .right-content{
137
+ padding:70px 0 0 0;
138
+ background-color: yellow;
139
+ width: 200px;
140
+ height: 300px;
141
+ float: right;
142
+ }
143
+ .bottom-content{
144
+ background-color: green;
145
+ height: 250px;
146
+ width:100%;
147
+ margin-top:;
148
+ float:left
149
+ }
150
+
151
+ footer{
152
+ clear:both;
153
+ position: fixed;
154
+ height: 60px;
155
+ width:100%;
156
+ background-color: aqua;
157
+ margin-top:600px;
158
+ }
159
+ </style>
160
+
161
+
162
+ </body>
163
+ </html>
84
164
  ```