[英]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.