[英]Aligning Div to the bottom right
我想在页面的右下角添加两个元素,我经历了几个线程,但有些部分有所帮助,而另一些则倾向于破坏布局。
注意:背景色仅供参考。 我希望文本右对齐。
这是我的位置:( http://jsfiddle.net/dsri/WswG9/ )
HTML:
<div id="container">
<div id="a"> <span id="aa">Text1</span></div>
<div id="b"> <span id="bb">Text2</span></div>
</div>
CSS:
div#container{
text-align: center;
}
span#aa{
font-size: 75px;
color: rgba(0, 0, 0, 0.5);
background-color: Yellow;
overflow: hidden;
}
span#bb{
font-size: 45px;
color: rgba(0,0,0,0.5);
background-color: red;
}
这就是我理想的情况: http : //i.imgur.com/ANuAvly.png
尝试将#container
div的CSS更改为:
div#container {
text-align: right;
position:absolute;
right:0;
bottom:0;
}
尝试这个
div#container {
text-align: right;
position:fixed;
right:0;
bottom:0;
}
像这样的东西: http : //jsfiddle.net/dsri/WswG9/ ?
div#container{
}
div#a,div#b{
text-align:right;
margin: 0 100px;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.