如何对齐中心+左/右

时间:2019-05-01 12:23:27

标签: html css twitter-bootstrap flexbox

我的例子:

   String macAddress = 
android.provider.Settings.Secure.getString(this.getApplicationContext().getContentResolver(), "android_id");
    Settings.Secure.GetString(this.ContentResolver, "android_id");

提琴:https://jsfiddle.net/lawagabi/f7tp3x26/1/

如何在不将文本扩展到整个宽度的情况下使文本在文本框中右对齐?

1 个答案:

答案 0 :(得分:0)

您的.container div类在这里有影响。使用right类将您的锚标签用一个跨度包裹起来,可以轻松地解决此问题。

<div class="container">
    <div class="d-flex justify-content-between my-auto">
        <div class="col justify-content-center flex-column d-flex">
            left
        </div>
        <div class="col justify-content-center flex-column d-flex">
          <span class="right"><a href="/">right</a></span>
        </div>
    </div>
</div>

Fiddle