【发布时间】:2018-08-09 22:34:17
【问题描述】:
这是我得到的。但我想要红色区域后面的矩形 Facebook 图像(目前它就在文本“请”后面)
#mlnk{
text-decoration:none;
position:relative;
top:40%;
left:0%;
color: #b5c5d6;
}
.container-corner-img{ /* **THIS IS TO BE PUSHED BACK** */
height: 40%; width: 70%;
position: absolute;
top: 5px; left:-75px;
}
.container{
width:50%;
height:30%;
background: linear-gradient(#8B9DC1, #3b5998);
padding:100px;
border-radius:12px;
position: relative;
font-family: sans-serif;
}
h1{ /* **THIS NEEDS TO BE BROUGHT TO FRONT** */
margin-left: auto;
margin-right: auto;
padding: 8px;
border-radius: 4px;
box-shadow: 0 4px 6px 0 rgba(0,0,0,0.2);
transition: 0.4s ease;
background-color: red;
margin-top: 0;
}
img{
height: 80%;
width: 50%;
}
<div class="container">
<div class="container-corner-img">
<img src="fbminimal.png">
</div>
<h1>
<a id="mlnk" href = "#link"> Please login to your facebook account first</a>
</h1>
</div>
我已经注释了 CAPS 中的 css 定义,我认为需要重点关注。
【问题讨论】:
-
背景颜色重叠,这正是我不想要的。
-
你能发布你的代码吗?如果不看 html 的结构,很难说出你需要什么。
-
Matthew Schlachter,我已经添加了代码。
标签: css image background padding behind