小编Vig*_*rar的帖子

我希望这个<p>标签到达图像的底部?

我对这个html/css完全不熟悉我试图将带有背景的文本浮动为图像.是的我做了但是问题是文本浮动在图像上.如果使用margin-top来调整图像,它只是简单地拉下整个div.Here down我给了我想要的图形表示.

在此输入图像描述

HTML

<div class="maincon">
    <div class="picon" style="background-image: linear-gradient(to bottom, rgba(0, 0, 0, .02), rgba(0, 0, 0, .8)), url('img/apple.jpg') "><p>Hi</p> 
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS

.maincon {
    margin-top: 95px;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    height: 100%;
}

.picon {
    width: 100%;
    height: 80%;
    background: none center/cover #f2f2f2;
}

.picon p {

}
Run Code Online (Sandbox Code Playgroud)

html css

6
推荐指数
2
解决办法
102
查看次数

标签 统计

css ×1

html ×1