简体   繁体   English

使用bootstrap在同一div中的顶部和底部对齐?

[英]Alignment left on top and bottom in same div with bootstrap?

I'm trying to align a row of buttons on the bottom but also have two rows of text at the top both justified left using twitter bootstrap. 我正在尝试在底部对齐一行按钮,但在顶部也有两行文本,都使用twitter bootstrap左对齐。 Here is what I'm trying to achieve: 这是我要实现的目标:

在此处输入图片说明

Here is a jsfiddle of my recent attempt: 这里是一个的jsfiddle我最近尝试:

My current css files look like this: 我当前的css文件如下所示:

.profile-avatar {
  position:relative; 
  height:170px;
}

.profile-avatar img {
  height: 160px;
  width: 160px;
  margin-left: 20px;
}


.profile-buttons {
  margin-left: 15px;
  margin-top: 110px;
}

I'm completely lost on how to add two rows of text to the top right of the image above the three buttons. 我完全不知道如何在三个按钮上方的图像右上方添加两行文本。

Any thoughts? 有什么想法吗?

Thanks, -Paul 谢谢-保罗

Try with position: absolute; 尝试使用position: absolute; (watch fiddle ) (观看小提琴

http://jsfiddle.net/kks6h0bc/7/ http://jsfiddle.net/kks6h0bc/7/

.text-0,.text-1{
    position: absolute;
    top: 0px;
   left: 200px;
    display:block;

}
.text-0{
    top: 0px;
    font-size:30px;
}

.text-1 {
    top: 50px;
}

Check this Fiddle . 检查这个小提琴 I Hope it helps. 希望对您有所帮助。

<div class="row">
<div class="col-xs-12">
    <div class="row">
        <div class="col-xs-3">
            <div class="profile-avatar">
                <div class="row">
                    <div class="col-xs-12">
                       <img src="http://www.kanorika.com/friendly/demo/data/avatars/min4/SyWH14RnFCt.jpg" class="profile-img img-responsive"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-9">
            <div class="row">
                <div class="col-xs-12">
                    Large Text<br>Small Text
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12">
                    <button type="button" class="btn btn-default profile-buttons">Default</button>
                    <button type="button" class="btn btn-default profile-buttons">Default</button>
                    <button type="button" class="btn btn-default profile-buttons">Default</button>
                </div>
            </div>
        </div>
    </div>
</div>
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM