简体   繁体   中英

CSS3 effect not Working

I created a site. and I call a image from DIV CSS

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

And I want this image that same link It is Possible from CSS? Thanks

The following CSS should get you started (where .sample-box is a class applied to the image or it's containing 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" */
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM