質問編集履歴

1

html編集、sass追加

2019/01/11 02:06

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -20,43 +20,159 @@
20
20
 
21
21
  ```ここに言語を入力
22
22
 
23
- <header>
24
-
25
- <!-- ヘッダー -->
26
-
27
- </header>
23
+ <header class="l-header">header</header>
28
24
 
29
25
 
30
26
 
31
- <div class="content">
27
+ <div class="l-container">
32
28
 
33
- <main>
29
+ <aside class="l-sidebar">
34
30
 
35
- <!-- メインコンテンツ -->
31
+ <div class="l-sidebar__inner">
36
32
 
37
- </main>
33
+ <ul>
38
34
 
39
- <div class="sidebar">
35
+ <li class="l-sidebar__item">menu</li>
40
36
 
37
+ <li class="l-sidebar__item">menu</li>
38
+
39
+ <li class="l-sidebar__item">menu</li>
40
+
41
+ <li class="l-sidebar__item">menu</li>
42
+
43
+ <li class="l-sidebar__item">menu</li>
44
+
45
+ <li class="l-sidebar__item">menu</li>
46
+
47
+ <li class="l-sidebar__item">menu</li>
48
+
49
+ <li class="l-sidebar__item">menu</li>
50
+
51
+ <li class="l-sidebar__item">menu</li>
52
+
53
+ <li class="l-sidebar__item">menu</li>
54
+
55
+ <li class="l-sidebar__item">menu</li>
56
+
57
+ <li class="l-sidebar__item">menu</li>
58
+
59
+ </ul>
60
+
61
+ </div>
62
+
41
- <!-- サイドバー -->
63
+ </aside>
64
+
65
+ <main class="l-main">
66
+
67
+ <p>text</p><p>text</p><p>text</p><p>text</p><p>text</p>
68
+
69
+ <p>text</p><p>text</p><p>text</p><p>text</p><p>text</p>
70
+
71
+ <p>text</p><p>text</p><p>text</p><p>text</p><p>text</p>
72
+
73
+ <p>text</p><p>text</p><p>text</p><p>text</p><p>text</p>
74
+
75
+ <p>text</p><p>text</p><p>text</p><p>text</p><p>text</p>
76
+
77
+ <p>text</p><p>text</p><p>text</p><p>text</p><p>text</p>
78
+
79
+ <p>text</p><p>text</p><p>text</p><p>text</p><p>text</p>
80
+
81
+ <p>text</p><p>text</p><p>text</p><p>text</p><p>text</p>
82
+
83
+ <p>text</p><p>text</p><p>text</p><p>text</p><p>text</p>
84
+
85
+ </main>
42
86
 
43
87
  </div>
44
88
 
45
- </div>
46
89
 
47
90
 
48
-
49
- <footer>
50
-
51
- <!-- フッター -->
52
-
53
- </footer>
91
+ <footer class="l-footer">footer</footer>
54
92
 
55
93
  ```
56
94
 
57
95
 
58
96
 
97
+ ```
98
+
99
+
100
+
101
+ .l-header,
102
+
103
+ .l-footer
104
+
105
+ color: #fff
106
+
107
+ text-align: center
108
+
109
+ height: 50px
110
+
111
+ line-height: 50px
112
+
113
+ background-color: #333
114
+
115
+
116
+
117
+ .l-container
118
+
119
+ display: flex
120
+
121
+
122
+
123
+ .l-sidebar
124
+
125
+ width: 250px
126
+
127
+ min-width: 250px
128
+
129
+ height: 100%
130
+
131
+ &__inner
132
+
133
+ width: 250px
134
+
135
+ min-width: 250px
136
+
137
+ height: 100%
138
+
139
+ position: fixed
140
+
141
+ top: 50px
142
+
143
+ left: 0
144
+
145
+ overflow-y: scroll
146
+
147
+ background-color: #f00
148
+
149
+ &__item
150
+
151
+ padding: 20px
152
+
153
+
154
+
155
+ .l-main
156
+
157
+ width: calc(100% - 250px)
158
+
159
+ background-color: #eee
160
+
161
+ ```
162
+
163
+
164
+
165
+ ### 上記のhtmlとsassでの問題点
166
+
167
+
168
+
169
+ - スクロールしたら、サイドバーの上に隙間が空いてしまう(ヘッダーの高さ分、topで下にずらしているから)
170
+
171
+ - 下までスクロールしたら、fixedで固定している箇所(左側)がフッターの上に来てしまう
172
+
173
+
174
+
59
- ### つまずいている箇所
175
+ ### 試したこと
60
176
 
61
177
 
62
178