2015-02-24 110 views
1

你好我發生過這個問題兩次,我似乎無法修復第二個問題。第一次它發生了一個圖像,我使用了最大高度,寬度來防止它一旦放大,但對於包含鏈接的頁腳,它不會這樣做。防止文本溢出指定的div

我試過position:absolute;還有很多我從谷歌看到的其他答案,但過去四十分鐘我一直在困擾這個問題,而我只是畫空白。

#footer { 
    padding-top: 0.5%; 
    width: 98%; 
    height: 9%; 
    padding-left: 1%; 
    padding-right: 1%; 
    text-align: center; 
    background-color: #00FF1E; 
} 
#footer li { 
    max-width: 100%; 
    max-height: 100%; 
    display: inline; 
    padding: 1%; 
    background: #7e7e7e; /* Old browsers */ 
    background: -moz-linear-gradient(top, #7e7e7e 0%, #595959 34%, #6d6d6d 60%, #666666 93%); /* FF3.6+ */ 
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7e7e7e), color-stop(34%, #595959), color-stop(60%, #6d6d6d), color-stop(93%, #666666)); /* Chrome,Safari4+ */ 
    background: -webkit-linear-gradient(top, #7e7e7e 0%, #595959 34%, #6d6d6d 60%, #666666 93%); /* Chrome10+,Safari5.1+ */ 
    background: -o-linear-gradient(top, #7e7e7e 0%, #595959 34%, #6d6d6d 60%, #666666 93%); /* Opera 11.10+ */ 
    background: -ms-linear-gradient(top, #7e7e7e 0%, #595959 34%, #6d6d6d 60%, #666666 93%); /* IE10+ */ 
    background: linear-gradient(to bottom, #7e7e7e 0%, #595959 34%, #6d6d6d 60%, #666666 93%); /* W3C */ 
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7e7e7e', endColorstr='#666666', GradientType=0); /* IE6-9 */ 
    -webkit-border-radius: 15px; 
    -moz-border-radius: 15px; 
    border-radius: 15px; 
    font-size: 30px; 
    word-wrap: break-word; 
} 
#footer a { display: inline-block; } 

HTML:

回答

3

嘗試這樣的:Demo

CSS:

.clearfix:after { 
    content: "."; 
    visibility: hidden; 
    display: block; 
    height: 0; 
    clear: both; 
} 

HTML:

<div id="footer" class="clearfix">...</div> 

來源Link

+0

你是我愛上網謝謝你的原因。我所要做的就是在你給我的代碼的底部添加填充,使其具有我想要的工作風格。謝謝。感謝Etash。 – connormcwood 2015-02-24 06:23:38

+0

不用客氣,馬克如果回答的話有幫助! :) – 2015-02-24 06:30:15