如何将文本放在“盒子”的右上角或右下角,使用css [英] How to put text in the upper right, or lower right corner of a "box" using css

查看:479
本文介绍了如何将文本放在“盒子”的右上角或右下角,使用css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何得到这里和这里在右边,与lorem ipsums?请参阅以下内容:

  Lorem Ipsum etc ........ here 
blah .......................
blah blah ..................
blah .......................
lorem ipsums ....... and here


解决方案

 < div style =position:relative; width:250px;> < div style =position:absolute; top:0; right:0; width:100px; text-align:right;>这里< / div> < div style =position:absolute; bottom:0; right:0; width:100px; text-align:right;>和这里< / div> Lorem Ipsum等< br /> blah< br /> blah blah< br /> blah< br /> lorem ipsums< / div>  



可能需要调整顶部和底部值。


How would I get the here and and here to be on the right, on the same lines as the lorem ipsums? See the following:

Lorem Ipsum etc........here  
blah.......................  
blah blah..................  
blah.......................  
lorem ipsums.......and here

解决方案

<div style="position: relative; width: 250px;">
  <div style="position: absolute; top: 0; right: 0; width: 100px; text-align:right;">
    here
  </div>
  <div style="position: absolute; bottom: 0; right: 0; width: 100px; text-align:right;">
    and here
  </div>
  Lorem Ipsum etc <br />
  blah <br />
  blah blah <br />
  blah <br />
  lorem ipsums
</div>

Gets you pretty close, although you may need to tweak the "top" and "bottom" values.

这篇关于如何将文本放在“盒子”的右上角或右下角,使用css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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