【发布时间】:2019-10-02 00:35:22
【问题描述】:
我正在尝试为我正在处理的页面设置页眉。
标题的高度应设置在中心的主图像上。旁边是一对 div 一个在另一个之上,在 y 而不是 z 中。这两个的下面是一个小图像,上面是一些文字。小图像总是比主图像短。
我想要的是对齐两个图像的底部,在较小的图像上方留出空间。然后我希望文本 div 自动填充该空间。
这是我目前为止最好的。有什么办法可以让它做我想做的事吗?
body {
margin: 0;
padding: 0;
overflow-y: hidden;
overflow-x: hidden;
}
html {
height: 100%;
width: 100%
}
.outertable {
display: table;
width: 100%;
height: 100%;
}
.headerrow {
display: table-row;
height: 0px;
background-color: #ffff80
}
.fillimage {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
background-color: #80ff80
}
.pad40 {
display: table-cell;
width: 40px;
background-color: #ff80ff
}
.widthofcontents {
display: table-cell;
width: 0px;
}
.columntable {
display: flex;
flex-flow: column;
}
.textfillavailable {
font-size:25px;
flex-grow: 1;
}
.heightofcontents {
height: 0px;
}
.bodyrow {
display: table-row;
height: 100%;
}
.bodycontent {
}
<div class="outertable">
<div class="headerrow">
<div class="fillimage">
<img src="http://placekitten.com/250/120" />
</div>
<div class="pad40">
</div>
<div class="widthofcontents">
<div class="columntable">
<div class="textfillavailable">
Hello
</div>
<div class="heightofcontents">
<img src="http://placekitten.com/90/70" />
</div>
</div>
</div>
<div class="pad40">
</div>
</div>
<div class="bodyrow">
<div class="bodycontent" contentEditable="true" />
</div>
</div>
-- 编辑--
Ascii 艺术展示了我想要的东西
+-------------------------------+----------+
| | Text |
| Large +----------+
| Image | Small |
| | Image |
+-------------------------------+----------+
将整行的高度设置为大图像的高度。
【问题讨论】:
-
对不起,您的文字描述非常混乱。你能画一幅画或其他东西,或者提供一个你想要实现的例子吗?
-
@EGC 我原以为运行 sn-p 会很清楚,但我添加了一些 ASCII 艺术以使其 100% 清晰。
-
那是一些美丽的艺术
-
您确定不想使用背景图片吗?