html - 无法使用 bootstrap 3 设置列的高度

标签 html css twitter-bootstrap responsiveness

我无法为这两列设置确定的高度。 我为每个 div 列、联系人和关于设置类。列拉伸(stretch)的唯一方法是当我用内容填充它或将其设置为确定的像素高度但是当我缩小页面时它们堆叠并且接触行被底部左右的行吞没。这里的例子 enter image description here

http://codepen.io/Chris-Brennan/pen/rOWYab?editors=110

这就是我要实现的目标。

enter image description here

<div class="container" id="contact_container">
    <div class="row">               
        <div class="col-md-6 contact">
            <p><a href="pdf/resumeChris.pdf" download>Download: Resume</a><p>
            <p><a href="mailto:webmaster@example.com">emailpgh@gmail.com</a></p>
            <img class="pull-right" src="https://d22r54gnmuhwmk.cloudfront.net/photos/8/tt/ub/WotTuBQzQzQoeZY-128x128-noPad.jpg" alt="chris">
        </div>  <!---contact container---> 

        <div class="col-md-6 about">
            <p><span style="color:tomato">About Me</span> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. <span style="color:tomato">Currently seeking Junior Design position.</span></p>
        </div> <!---about container--->
    </div>   <!---end row--->    
</div>  <!------end container----->

body{
    font-family:'Montserrat',sans-serif;
    margin-top:50px;
}
#contact_container {
    height:100%;
    padding:0 50px;
    border:1px solid red;
    overflow:hidden;
}
.contact {
    height:100%;
    padding:30px;
    background:tomato;
}
.contact p{
    font-size:1.5em;
}
.contact a{
    color:white;
}
.contact img{
    position:absolute;
    top:20px;
    right:20px;
}
.about {
    height:100%;
    padding:30px;
    background: #34495e;
    color:white;
}

/* Iphone/Android (Small Devices) ----------- */
@media only screen and (min-width : 320px) and (max-width: 767px) {
    /* Styles */
    #contact_container {
        padding:0 50px;
    }
    .contact {
        height:100%;
        padding:30px;
        background:tomato;
        font-weight:700;
    }
    .contact p{
        text-align:center;
        font-size:1.5em;
    }
    .contact a{
        color:white;
    }
    .contact img{
    }
    .about {
        height:100%;
        padding:30px;
        background: #34495e;
        color:white;
    }

最佳答案

bootstrap的网格系统是可以嵌套的。 看这个例子:

<div class="col-md-6 contact">
   <div class="col-xs-12-md-8">
      <p><a href="pdf/resumeChris.pdf" download>Download: Resume</a></p>
      <p><a href="mailto:webmaster@example.com">emailpgh@gmail.com</a></p>
   </div>
   <div class="col-xs-12-md-4">
      <img class="pull-right" src="https://d22r54gnmuhwmk.cloudfront.net/photos/8/tt/ub/WotTuBQzQzQoeZY-128x128-noPad.jpg" alt="chris">
   </div>
</div>

关于html - 无法使用 bootstrap 3 设置列的高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32813552/

相关文章:

jquery - Bootstrap - WYSIWYG HTML5 编辑器不更新底层文本区域

javascript bootstrap-multiselect 在按钮单击时获取所有选定的值

html - 字段集宽度父级的 100%

html - Bootstrap 水平对齐

html - 页面上无法解释的溢出 x

javascript - 使用 Vue 和 HTML 在 JavaScript 中制作幻灯片,但图像出现错误 404 "Not found"

css - 卡在媒体查询上

html - 一些我无法解决的 IE6 怪癖

css - Android 浏览器 - anchor 聚焦时删除轮廓边框

django - 将 Twitter Bootstrap 主题应用于 Django 网站