CSS集中在屏幕底部的HTML5 div [英] CSS to centralise a HTML5 div at the bottom of the screen

查看:291
本文介绍了CSS集中在屏幕底部的HTML5 div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下HTML5文档:

I have the following HTML5 document:

<canvas id="myCanvas">
</canvas>
<img id="logo" src="/images/logo.png" style="visibility:collapse" />
<div id="adControl" style="width: 728px; height: 90px; border: solid 1px red; visibility:visible;"
    data-win-control="MicrosoftNSJS.Advertising.AdControl"
    data-win-options="{applicationId: 'xyz', adUnitId: '123'}">
</div>

我试图让adcontrol出现在屏幕底部帆布。这是我的CSS:

I'm trying to make the adcontrol appear in the centre at the bottom of the screen, beneath the canvas. Here's my CSS:

#adControl {   

    float:left; 

    margin: 0px auto;

}

#myCanvas {

    float:left;

}

我已经尝试了adcontrol

I've tried various combinations of margin for the adcontrol, but don't seem to be able to centralise it.

推荐答案

这样做是否意味着这样?

Do yo mean something like this?

.box {
    width:1024px;
    margin: 0px auto;
}
#adControl {   
    position:fixed;
    bottom:0;
    width: 728px; 
    height: 90px;
    border: solid 1px red; 
    visibility:visible;
}

这篇关于CSS集中在屏幕底部的HTML5 div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆