5 / 5 / 3
Регистрация: 20.01.2012
Сообщений: 218
1

Футер, привязка кнопки вниз блока

05.10.2016, 23:56. Показов 4624. Ответов 4
Метки нет (Все метки)

Author24 — интернет-сервис помощи студентам
Доброй ночи.
Пару вопрос от новичка в верстке
Сейчас учусь верстать и на втором своем шаблоне столкнулся с проблемой. Не могу сделать толковый футер и не могу привязать кнопку к низу блока с контентом.

Как это выглядит на макете и как у меня. Скриншоты прикрепил


Код html:
HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>BlogTemplate by Konark</title>
    <link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
    <div id="header">
        <div id="mainheader">
            <div id="logo">Blog Template</div>
            <div id="topmenu">
                <ul>
                    <li><a href="/">Home</a></li>
                    <li><a href="#">About</a></li>
                    <li><a href="#">Consulting</a></li>
                    <li><a href="#">Contact</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div id="wrapper">
        <div id="content">
            <div class="title">
                <div class="date"><p class="day">4</p><p class="month">jan</p></div>
                <div class="text-title">Will the new Macbook be ultra thin?
                <p>Posted by <a href="#">Jonnotie</a> on 4 January 2008 — <a href="#">8 Comments</a></p>
                </div>
                <div class="post">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in Ut enim ad minim veniam, quis nostrud exercitation.</p>
                    <p>voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                    <div class="contin"><a href="#">Continue reading</a> »</div>
                </div>
                <hr/><br/>
                
                <div class="date"><p class="day">3</p><p class="month">jan</p></div>
                <div class="text-title">Let’s talk about the amazing Jonno
                <p>Posted by <a href="#">Jonnotie</a> on 3 January 2008 — <a href="#">235 Comments</a></p>
                </div>
                <div class="post">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                    <div class="contin"><a href="#">Continue reading</a> »</div>
                </div>
                <hr/><br/>
 
                <div class="date"><p class="day">2</p><p class="month">jan</p></div>
                <div class="text-title">How to be a succesful entrepeneur
                <p>Posted by <a href="#">Jonnotie</a> on 2 January 2008 — <a href="#">4 Comments</a></p>
                </div>
                <div class="post">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
                    <div class="contin"><a href="#">Continue reading</a> »</div>
                </div>
                <hr/><br/>
            </div>
                    <div class="prev"></div>
        </div>
        
        <div id="sidebar">
            <h2>About me</h2>
            <div class="sidebar-line"></div>
            <div class="author"></div>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis trud exercitation ullamco laboris nisi. ut.</p>
            <div class="sidebar-line"></div>
            <div id="subscribe">
                <h2>Subscribe</h2>
                <ul>
                    <div class="sidebar-line"></div>
                    <li class="rss"><a href="#">Recent comments</a></li>
                    <div class="sidebar-line"></div>
                    <li class="rss"><a href="#">Recent articles</a></li>
                    <div class="sidebar-line"></div>
                </ul>
            </div>
            <div id="categor">
                <h2>Categories</h2>
                <ul>
                    <div class="sidebar-line"></div>
                    <li class="cat"><a href="#">General</a><span>12 articles</span></li>
                    <div class="sidebar-line"></div>
                    <li class="cat"><a href="#">Fame</a><span>3 articles</span></li>
                    <div class="sidebar-line"></div>
                    <li class="cat"><a href="#">PR</a><span>4 articles</span></li>
                    <div class="sidebar-line"></div>
                    <li class="cat"><a href="#">Blogs</a><span>2 articles</span></li>
                    <div class="sidebar-line"></div>
                    <li class="cat"><a href="#">Social networks</a><span>6 articles</span></li>
                    <div class="sidebar-line"></div>
                    <li class="cat"><a href="#">Money</a><span>3 articles</span></li>
                    <div class="sidebar-line"></div>
                    <li class="cat"><a href="#">Networks</a><span>10 articles</span></li>
                    <div class="sidebar-line"></div>
                </ul>
            </div>
 
        </div>
        
    </div>
<footer></footer>
</body>
</html>
CSS:
CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
@import url(reset.css);
 
@font-face {
    font-family: Helvetica; /* Имя шрифта */
    src: url(../font/HelveticaNeue-Light.ttf); /* Путь к файлу со шрифтом */
   }
 
 @font-face {
    font-family: Lucida; /* Имя шрифта */
    src: url(../font/Lucida.ttf); /* Путь к файлу со шрифтом */
 }
 
body {
    background-color: #2d3844;
}
 
#header{
    width: 100%;
    height: 177px;
    background-color: #222a33;
    margin-top: 10px;
}
 
#mainheader{
    width: 900px;
    margin: 0 auto;
}
 
#wrapper{
    width: 900px;
    margin: 0 auto;
}
 
#logo {
    font-family: Helvetica;
    font-size: 30px;
    color: #ffffff;
    padding-top: 68px;
    margin-left: 15px;
    float:left;
}
 
footer{
    height: 80px;
    width: 100%;
    margin: 0 auto;
}
 
#topmenu {
    float: right;
    padding-top: 35px;
}
 
#topmenu li{
    background: url(../images/fon-menu.png) no-repeat;
    width: 280px;
    height: 25px;
    padding-top: 1px;
}
 
#topmenu a{
    font-family: Lucida;
    color: #50555a;
    text-decoration: none;
    font-size: 14px;
    float:left;
    margin: 4px 10px;
}
 
#topmenu a:hover{
    color: #ede9dc;
    text-decoration: underline;
}
 
#content{
    width: 600px;
    height: 930px;
    background-color: #ede9dc;
    border-radius: 8px;
    margin-top:17px; 
    float:left;
}
 
#sidebar {
    height: 930px;
    width: 280px;
    margin-top: 37px;
    float:right;
}
 
#sidebar h2{
    font-family: Lucida;
    font-size: 17px;
    color: #ede9dc;
}
 
.sidebar-line{
    background-color:#414a53;
    width: 280px;
    height: 1px;
    margin-top: 2px;
    margin-bottom: 2px;
}
 
.author{
    margin-top: 9px;
    background: url(../images/author.jpg) no-repeat;
    width: 87px;
    height: 104px;
    float:left;
    padding-right: 9px;
    margin-bottom: 9px;
}
 
#sidebar p{
    font-family: Lucida;
    font-size: 11px;
    line-height: 1.4;
    color: #ede9dc;
    margin-top: 9px;
    margin-bottom: 9px;
 
}
 
#subscribe{
    margin: 0 auto;
    padding-top: 35px;
}
 
#categor{
    margin: 0 auto;
    padding-top: 35px;
}
 
#sidebar a{
    text-decoration: none;
    font-size: 11px;
    font-family: Lucida;
    color: #ede9dc;
}
 
#sidebar a:hover{
    text-decoration: underline;
}
 
 
#subscribe li{
    text-align: left;
    padding-left: 20px;
    padding-bottom: 3px;
}
.rss{
    margin-left: 10px;
    background: url(../images/rss.png) no-repeat;
}
 
#categor ul{
 
}
 
.cat{
    list-style-type: disc;
    color: #ede9dc;
    margin-left: 30px;
}
 
#categor li{
}
 
#categor span{
    margin-top: 2px;
    font-size: 11px;
    font-style: italic;
    font-family: Lucida;
    color: #ede9dc;
    overflow: hidden;
    float:right;
}
 
.title{
    margin-top: 20px;
    margin-left: 20px;
    width: 560px;
    height: 42px;
}
 
.date{
    width: 42px;
    height: 42px;
    background: url(../images/date.png) no-repeat;
    float:left;
}
 
.day{
    font-family: Lucida;
    font-size: 15px;
    color: #ede9dc;
    padding-left: 16px;
    padding-top: 5px;
}
 
.month{
    font-family: Lucida;
    font-size: 11px;
    color: #707270;
    padding-top: 7px;
    padding-left: 14px;
}
 
.text-title{
    padding-left: 62px;
    padding-top: 6px;
    font-family: Lucida;
    font-size: 20px;
    color: #2d3844;
}
 
.text-title p, a{
    padding-top: 2px;
    font-family: Lucida;
    font-size: 11px;
    color: #b9b6ac;
}
 
.post{
    width: 560px;
    padding-top: 20px;
    font-family: Lucida;
    font-size: 12px;
    color: #3b3a37;
    line-height: 1.6;
}
 
.post p{
    padding-bottom: 20px;
}
 
.contin, .contin a{
    font-family: Lucida;
    font-size: 12px;
    color: #222a33;
    font-style: italic;
    text-align: right;
    padding-bottom: 15px;
}
 
.prev{
    background: url(../images/next-prev.png) no-repeat;
    width: 200px;
    height: 37px;
    position: absolute;
    bottom: 0;
}
Миниатюры
Футер, привязка кнопки вниз блока   Футер, привязка кнопки вниз блока  
0
Лучшие ответы (1)
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
05.10.2016, 23:56
Ответы с готовыми решениями:

Футер не хочет уходить вниз
Если убрать элемент ul class nav то все отлично. Если оставить мегаменю ,то футер прилипает не к...

Футер прижать вниз браузера
Добрый день ! не получается футер прижать в низ браузера, подскажите как это лучше сделать исходя...

Прилепить контент вправо и футер вниз
http://algosource.esy.es/ нужно чтобы контент уехал вправо, рядом с навигацией, а футер вниз. с...

Помощь в верстке (Футер отправить вниз)
Всем привет, вот проблемка есть одна. Футор прилип почти к началу документа, знаю проблемка в том...

4
511 / 485 / 161
Регистрация: 08.07.2013
Сообщений: 1,714
Записей в блоге: 1
06.10.2016, 10:30 2
Лучший ответ Сообщение было отмечено Konark как решение

Решение

для контентной области:
CSS
1
position: relative; padding-bottom: 20px;
для кнопки (поместить ее в котентную область):
CSS
1
position:absolute; bottom: 0; left: 50%; transform: translateX(-50%);
1
5 / 5 / 3
Регистрация: 20.01.2012
Сообщений: 218
06.10.2016, 19:52  [ТС] 3
Для кнопки помогло, а вот футер так и не появился...
0
105 / 104 / 59
Регистрация: 21.10.2013
Сообщений: 346
06.10.2016, 22:16 4
Пересмотри стили. У id="content" и id="sidebar" стоит определенная высота, постарайся переделать на "auto" или убрать ее вообще. К тому же пересмотри ВЕСЬ контент в блоке с id="content" - у тебя есть зафлоченые элементы, а очищения потоков стилей нет, из за этого и может быть проблема
1
5 / 5 / 3
Регистрация: 20.01.2012
Сообщений: 218
06.10.2016, 23:33  [ТС] 5
Цитата Сообщение от Kenworth Посмотреть сообщение
Пересмотри стили. У id="content" и id="sidebar" стоит определенная высота, постарайся переделать на "auto" или убрать ее вообще. К тому же пересмотри ВЕСЬ контент в блоке с id="content" - у тебя есть зафлоченые элементы, а очищения потоков стилей нет, из за этого и может быть проблема
Помогла очистка потоков стилей + добавил выше код для контента в wrapper, так как content это лишь внутренний блок.

Спасибо огромное всем.

Надеюсь не так плохо как для первого сверстанного шаблона.
Миниатюры
Футер, привязка кнопки вниз блока  
0
06.10.2016, 23:33
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
06.10.2016, 23:33
Помогаю со студенческими работами здесь

При скроллинге футер уходит вниз
Добрый день ребят! Такая проблема вообщем возникла. Делаю &quot;учебник&quot; для дипломного проекта....

Опустить футер вниз экрана и добавить описание к рубрикам
Уважаемые, профессионалы! Помогите, пожалуйста, новичку разобраться как правильно опустить футер...

Как сделать, чтоб футер не уезжал вниз при наполнении контента
subj... index.php &lt;div id=&quot;page&quot;&gt; &lt;/div&gt;&lt;!--конец блока page--&gt; &lt;!-- Footer --&gt; &lt;footer...

Как опустить футер вниз, если у меня все блоки абсолютны?
Здравствуйте. Помогите пожалуйста. Как сделать такую вещь: 2 сайдбара по бокам с фиксированной...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
5
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru