我想将这两个div的内容放在顶部。
HTML
<div class="menu">
<div></div>
</div>
<div class="content">
<h1>SDFSDFSD SDFSD</h1>
<h1>SDFSDFSD SDFSD</h1>
<h1>SDFSDFSD SDFSD</h1>
</div>
CSS
menu {
display: table-cell;
background-color: yellow;
width: 20%;
}
.menu > div {
padding: 20px;
background-color: red;
vertical-align: top;
}
.content {
display: table-cell;
background-color: blue;
width: 80%;
}
我尝试使用vertical-align:top和position:absolute和top:0但没有运气。
如何将这些内容发送到容器的顶部呢?
提前致谢!
答案 0 :(得分:1)
您将table-cell
添加到了错误的位置,它应该应用于def repo = 'example-sensu-rspec-tests'
node {
git url: 'https://github.com/bsnape/jenkins-workflow-example.git'
common = load 'common.groovy'
flow = load 'flow2.groovy'
common.clone(repo)
flow.unit()
flow.acceptance()
common.deploy('staging')
}
元素。
答案 1 :(得分:1)
您需要将vertical-align
放在table-cell元素
.menu {
vertical-align: top;
}
.content {
vertical-align: top;
}
http://jsfiddle.net/99u4vm3g/1/
您将看到文本仍然不在顶部,这是由于标题元素上的边距
上没有边距