3
There is a simple way to make a beveled edge with CSS only, but transparent. No need for svg, png, etc?
Look what I’ve done so far: https://jsfiddle.net/Cafardo/zn5oysqy/5/
.home_fundo{
width: 300px;
height: auto;
background: url(http://www.simi.org.br/files/Janeiro%20-%202017/11096.jpg);
}
.home_banner_caixa {
width: 200px;
max-width: 400px;
height: auto;
position: relative;
background-color: #c77316;
padding: 20px;
font-size: 12px;
color: #ffffff;
}
.home_banner_caixa_chanfro {
width: 70px;
height: 70px;
position: absolute;
top: -10px;
right: -10px;
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
transform: rotate(45deg);
}
.home_banner_caixa_chanfro1 {
width: 70px;
height: 35px;
display: block;
background-color: #ffffff;
}
.home_banner_caixa_chanfro2 {
width: 70px;
height: 35px;
display: block;
background-color: #c77316;
}
<div class="home_fundo">
<div class="home_banner_caixa">
<div class="home_banner_caixa_chanfro">
<div class="home_banner_caixa_chanfro1"></div>
<div class="home_banner_caixa_chanfro2"></div>
</div>
<h1>
Lorem ipsum
<br> dolor sit amet, consectetur adipiscing elit. Duis vitae augue ut mi fermentum sodales. Sed euismod est mollis sem malesuada, vitae placerat est congue
</h1>
</div>
</div>
Notice that the bank corner should be transparent, I thought maybe there is some kind of jquery mask to make the white div of the chamfer transparent, or something like... can help me.?
Possible duplicate of Elements with Css cut corners
– Otto
You can also do it using pseudo element. I will answer the other question with this option if you are interested. []s
– hugocsl
Thanks, the post helped me a lot. The problem is that it would need to be transparent the beveled edge, and not with a color....
– caiocafardo
Take a look at the property
clip-path
in MDN clip-path CSS Property. *Observe the browser compatibility table.– Douglas Garrido
Thanks! But it works on few browsers....
– caiocafardo
It won’t look pretty, but I’ll make an example for you.
– hugocsl