html - 垂直线将文本推到其下方

标签 html twitter-bootstrap css

大家好,我正在尝试创建一个在 Bootstrap 中有反应的设计,如果我有一条垂直线向下,然后在它附近有一些文本,如下所示:enter image description here

我已经设法使用 bootstrap 3 网格系统创建了这个很好的,问题是,当我调整我的窗口大小时,我希望该行会变小但它所做的是将我的所有文本推到它下面,当我想要该行时to 和 text 保持完全一致

HTML:

<header class="masthead">
    <div class="container">
        <div class="row">
            <div class="col-md-1">
            <div class="verticalLine">
            </div>
            </div>
            <div class="col-md-7">
             <div class="maintext">
                <h1>Text</h1>
                <h2>Some text goes here</h2><br>
                <br>
                <br>
                <br>
                <br>
                <h1 style="width: 600px;">Great design is simplicity and clarity</h1><br>
                <h2 style=" margin-top: -19px;">Idea - Design - launch</h2><br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <p style="font-size: 19px;">View profile ➡</p>
            </div>
        </div>
        </div>
    </div>
</header>

CSS:

.verticalLine {
  border-left: thick solid #ff0000;
  height: 850px;
}

fiddle 链接:here你可以看到当窗口缩小时我所有的文本都在它下面,即使我使用媒体查询仍然没有任何反应

最佳答案

我想你想停止包装其余的元素:

.verticalLine {
  border-left: thick solid #ff0000;
  height: 850px;
  overflow: hidden;
  white-space: nowrap;
  float: left;
}

.maintext {
  padding-left: 30px;
}

所以像这样:https://jsfiddle.net/DTcHh/38279/

关于html - 垂直线将文本推到其下方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46699536/

相关文章:

javascript - 覆盖 Bootstrap 表选中的行背景颜色

javascript - Z-Index 不适用于画廊

html - 文本区域和文本缩进 : placeholder doesn't work properly on EDGE

JQuery Image Fade in Fade out without rel/abs 定位

html - 按钮并排对齐

javascript - 辨别触摸 Action 导致的上下文菜单事件?

html - z-index 不适用于将图像放在视频前面

html - Yii2 允许编辑页面样式的 CSS 文件在哪里

css - Bootstrap 搜索框和按钮与标题文本右侧对齐(不在导航栏中)

css - 如何让波浪占据屏幕的 50%?