html - 如何将div内容设置到其父div的底部?

标签 html css

问题:我需要在其父 div 的内容底部放置标签为“THIS BUTTON”的按钮。

如何将 div 内容固定到其父元素的底部?

问题屏幕链接:Problem Screen

这是我的代码 jsfiddle 链接:JSFiddle

   .activity-default {
    border-width: 1px;
    border-style: solid;
    border-color:black;
    border-left-width: 2px;
    border-left-style: inset;
    border-left-color: transparent;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: lavender;
    border-bottom-left-radius: 20;
    padding-bottom: 1px;
    margin-top: 0px;
    /*border-width: 1px;
    border-style: solid;*/
}

.activity-default:hover {

    border-left-width: 2px;
    border-left-style: solid;
    border-left-color: lightseagreen;

}



.activity-content-seperator {
    border-left-width: 2px;
    border-left-style: solid;
    border-left-color: greenyellow;
    width: 100%;
}

.activity-button-bottom-fitter {
    height: 100%;
}

.dropdown-menu-filter {
    font-family: verdana, arial;
    font-weight: normal;
    padding: 5px 10px 0;
    max-height: 300px;
    overflow-y: scroll;

}


/* Comments */
.comment-time {
  font-size: 12px;
  color: #656565;
  padding-right: 10px;
}

.comments {
  padding-top: 20px;
}

.comment {
  margin-bottom: 10px;
  }
}

<div class="panel panel-default">
                <div class="panel-heading">Başlık </div>
                <div class="panel-body">
  <div class="col-lg-12 activity-default">

                        <div class="col-lg-12">

                            <div class="row comment-title">
                                <span class="glyphicon glyphicon-comment"></span><b>Title</b>
                            </div>
                            <div class="row comment-content">

                                <div class="col-lg-2">
                                    <div class="row">A.B.</div>
                                    <div class="row">10.03.2014</div>
                                    <div class="row">19:21</div>


                                    <div class="row">
                                        <button id="mybutton" class="btn btn-md btn-default" style='margin-bottom: 1px; margin-right: 2px; white-space: normal;'><span class="glyphicon glyphicon-flag text-red"></span>THIS BUTTON</button>
                                    </div>


                                </div>
                                <div class="col-lg-10">

                                    <div class="row col-lg-12 activity-content-seperator">
                                        <div class="row col-lg-12">
                                            <h5>Title</h5>
                                        </div>
                                        <div class="row col-lg-12">
                                            <p>
                                                Some notes here some notes here lorem ipsum etc 
                                            </p>
                                            <ul>
                                                <li>Elem1</li>
                                                <li>Elem1</li>
                                                <li>Elem1</li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>

</div>
            </div>
        </div>
    </div>

最佳答案

您可以在父 div 上设置 position: relative;

然后设置position:absolute; bottom:0; 在子 div 上

关于html - 如何将div内容设置到其父div的底部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22252804/

相关文章:

html - 使用 CSS 创建 div 的对 Angular 线顶部

javascript - 使用 jquery 选择当前聚焦的 contenteditable div

html - Angular - ng 类在 td 上工作但不在 tr 上工作

jquery stop() 导致悬停效果停止

html - XSL重复相同的XML元素/节点,无法正常工作

html - 如何实现float : top in CSS/HTML

html - CSS3,如何使我的渐变 WebKit 背景透明?

javascript - 在所有屏幕尺寸和溢出滚动上修复两个 div 顶部和底部

html - Header 中的多个图像适应屏幕分辨率 CSS

javascript - 调整浏览器大小时更改占位符