2014-12-18 7 views
-4

В настоящее время я работаю над веб-страницей и в процессе, я пытаюсь привести div, чей идентификатор «нижний колонтитул» на крайнем дне. Сначала это работало, но когда я разместил выделение на моей странице, div достиг 50px выше.Как довести нижний колонтитул до самого низа?

Как я могу избежать этого? Метод я использовал, чтобы поместить колонтитула в крайнее дно было путем укладки его на следующий синтаксис:

#footer{ position:absolute;bottom:0;} 
+0

Можете ли вы сделать jsFiddle в качестве примера? – AlexZ

+0

marquee устарел для использования, вместо этого использует jquery или анимацию css3 ... –

+0

Вы используете шатер? – Nit

ответ

0

фотография этот Sticky Footer

Однако шатровый тег довольно старый, и вы should'nt больше использоваться по крайней мере, с HTML5

0

Demo

HTML

<div id="container"> 
    <div id="header"> 
     <!-- Header start --> 
     <h1>How to keep footers at the bottom of the page (CSS demo)</h1> 
     <!-- Header end --> 
    </div> 
    <div id="body"> 
     <!-- Body start --> 
     <p>In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal. Read the In this demo the footer is pushed to the bottom of the screen in all standards compliant web browsers even when there is only a small amount of content on the page. This with work with IE 6 and IE 5.5 too. Non-standards compliant browsers degrade gracefully by positioning the footer under the content as per normal.</p> 
     <!-- Body end --> 
    </div> 
    <div id="footer"> 
     <!-- Footer start --> 
     <p><strong>Footer</strong> (always at the bottom).</p> 
     <!-- Footer end --> 
    </div> 
</div> 

Css

html, body { 
    margin:0; 
    padding:0; 
    height:100%; 
} 
#container { 
    min-height:100%; 
    position:relative; 
} 
#header { 
    background:#ff0; 
    padding:10px; 
} 
#body { 
    padding:10px; 
    padding-bottom:60px; 
    /* Height of the footer */ 
} 
#footer { 
    position:absolute; 
    bottom:0; 
    width:100%; 
    height:60px; 
    /* Height of the footer */ 
    background:#6cf; 
} 
/* other non-essential CSS */ 
#header p, #header h1 { 
    margin:0; 
    padding:10px 0 0 10px; 
} 
#footer p { 
    margin:0; 
    padding:10px; 
} 

Примечание : Если содержание вашего тела достаточно длинное, нижний колонтитул будет внизу страницы. Если контент достаточно короткий, он будет вставлен в нижней части экрана.