2013-08-20 105 views
2

我想在頁面的右側BUTTOM定位加載圖像,但一切工作正常,除了邊距。下邊距不起作用

<div id="preload"> 
    <div align="right" style="margin-bottom:40px; margin-right:50px;"> 
     <img src="http://thc-racing.ucoz.com/design/loading.gif" alt="" /> 
     <br> 
     <a style="color:#00ff24;"><b>Please wait while the page is loading... 
     <br>If the website doesn't load within one minute please refresh your page!</b>                         
     </a> 
    </div> 
</div> 

有人可以告訴我什麼或如何使它工作? 感謝

回答

2

您應該指定位置絕對和使用底部和右側proprietes。

http://jsfiddle.net/7yrUy/

<div id="preload"> 
<div align="right" style="position:absolute; bottom:40px; right:50px"> 
    <img src="http://thc-racing.ucoz.com/design/loading.gif" alt="" /> 
    <br><a style="color:#00ff24;"><b>Please wait while the page is loading...<br>If the website doesn't load within one minute please refresh your page!</b></a> 
</div> 

+0

工作的感謝! –

2

如果你想在頁面的右下角只使用CSS:如果你想改變量的像素更改爲0〜你想要什麼

5

這是

.yourClass { 
    position: absolute; 
    right: 0; 
    bottom: 0; 
} 

邊距與填充的性質。由於利潤率坐在元素之外,他們不會渲染,除非有下列其他元素。你可以在父用1像素的底部填充;應該觸發渲染。

+0

我會那樣做呢!甚至更好,刪除內部元件的保證金,並將其添加爲填充到外的元素。 – LinkinTED

2

嘗試絕對位置和使用底部/右側,而不是各自的利潤:

<img src="http://thc-racing.ucoz.com/design/loading.gif" alt="" style="position: absolute; bottom:40px; right:50px;"/> 

這裏 - http://jsfiddle.net/maximua/SKcvr/