Hello I have a border style on my boxes that
have a page effect.price-boxes:before , however it is showing
a white background on the border color.
I want to take to off the white color but
Im not sure what to declare in the CSS. Website
You could try some of the examples @lauren_olsen17 linked to, but by far the easiest solution here is to create a semi-transparent PNG image in Photoshop that includes the corner fold and use that as a background image on those boxes.
No worries. BTW, I would make it bigger than the actual boxes, just in case they get resized on someone’s browser. Position the image top right. Much more bulletproof than trying to mess with CSS3 etc.
@Ralph is right about the .png being more bullet-proof. Simpler is better.
FYI, for the future, the transparent folded corner is done by applying the background image in the corner box, then putting the triangle inside that box. Both image calls (the page background and the corner boxes) are {background-attachment:fixed}.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>folded corner</title>
<!--
http://www.sitepoint.com/community/t/border-style/206321
csosa
Nov 2, 2015 4:34 PM
-->
<style type="text/css">
html {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
overflow-y:scroll;
}
*,*:before,*:after {
box-sizing:inherit;
}
body {
background:#bdf url("images/mountain.jpg") no-repeat 0 0 fixed;
/* background-size:contain; /* if used, must use in two places */
padding:0;
margin:0;
}
.outer {
text-align:center;
}
.pricebox {
display:inline-block;
width:250px;
height:300px;
position:relative;
background-color:rgba(255,255,255,.35);
overflow:hidden; /* cuts off the right box shadow */
margin:1em;
/* outline:1px solid yellow; /* TEST Outline. TO BE DELETED. */
}
.pricebox::before,
.pricebox::after {
content:"";
position:absolute;
right:0;
}
.pricebox::before {
width:160px;
height:160px;
background:#bdf url("images/mountain.jpg") no-repeat 0 0 fixed;
/* background-size:contain; /* if used, must use in two places */
/* outline:1px dotted yellow; /* TEST Outline. TO BE DELETED. */
}
.pricebox::after {
width:0;
height:0;
border-bottom:160px solid rgba(255,255,255,.65);
border-right:160px dotted transparent;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), -1px 1px 1px rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body>
<div class="outer">
<div class="pricebox"></div>
<div class="pricebox"></div>
<div class="pricebox"></div>
<div class="pricebox"></div>
<div class="pricebox"></div>
<div class="pricebox"></div>
<div class="pricebox"></div>
</div>
</body>
</html>
In this demo, I exaggerated the folded corner.
Put a large image in the background (same image, two places in the CSS) to get a better idea of how it looks and works.
EDIT: 22:08 EST
I changed the code for the folded corner triangle so the fold appears smooth rather than having the little jaggies.
Ah yes, very nice. I’ve studied how to do gradients before, but then I don’t use them for a while and have to learn them all over again. It’s hard to work out how that code works by just looking. Sigh! Nice work, anyhow.