2013-08-20 104 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/