【发布时间】:2014-03-02 15:43:46
【问题描述】:
我正在使用以下代码将标题与图像的右下角对齐。代码运行良好。
我想知道是否可以重写它不指定图片容器(.picture 类)的最小宽度。调整浏览器窗口大小时,如果没有宽度,标题会向下移动:
<div class="picture">
<img src="image.jpg">
<div class='captioning'>
<div class='title'>text</div>
<div class='caption'>text</div>
</div>
</div>
.picture {
position: relative;
overflow: hidden;
min-width: 1200px;
}
.picture img {
float: left;
}
.picture .captioning {
float: left;
width: 150px;
margin: 0 0 0 15px;
}
.picture .captioning .caption {
position: absolute;
bottom: 0;
}
.picture .captioning .title {
position: absolute;
bottom: 0;
}
有什么想法吗?
提前致谢
【问题讨论】:
-
“降档”是什么意思?
-
它在照片下折叠
-
对不起,我还是不明白你的意思是什么行为
-
此行为:link
-
我现在看到了,但我无法重现该行为。也许您可以在 jsFiddle 或类似网站上创建一个示例?