CSS3效果不起作用

时间:2015-07-07 20:30:28

标签: html css css3

我创建了一个网站。我从DIV CSS

调用图像
.header_bottom_area {
  background: url(../img/HomepagePanels.jpg)no-repeat scroll center center;
  max-width: 100%;
  width: auto;
  height: 911px;
}

我希望这张图片相同link这可能来自CSS吗?感谢

1 个答案:

答案 0 :(得分:0)

以下CSS应该开始使用(其中.sample-box是应用于图像的类或者包含DIV的类):

.sample-box
{
    background-color: rgba(255, 0, 0, 0.5);
    height: 200px;
    width: 400px;
}

.sample-box::before 
{
    position: absolute;
    display: block;
    width: 0;
    height: 0;
    margin-top: 150px; /* same as height of this ::before item */
    margin-left: 0px; /* (padding * -1) of main element */
    content: "";
    border-width: 0px;
    border-style: solid;
    border-color: transparent;
    border-left-width: 400px; /* (width + padding) of main element */
    border-bottom-width: 50px; /* height of "mask" */
    border-bottom-color: rgba(255, 255, 255, 1.0); /* color of "mask" */
}

.sample-box::after 
{
    position: absolute;
    display: block;
    width: 0px;
    height: 0px;
    margin-top: 132px; /* adjust to make it work for you */
    margin-left: 0px; /* position ::after item horizontally */
    content: "";
    border-width: 0px;
    border-style: solid;
    border-color: transparent;
    border-right-width: 400px; /* (width + padding) of main element */
    border-bottom-width: 50px; /* height of "mask" */
    border-bottom-color: rgba(255, 255, 255, 1.0); /* color of "mask" */
}