I have this code
div {
width: 0;
height: 0;
border-style: solid;
border-width: 85px 85px 0 0;
border-color: #c00000 transparent transparent transparent;
float: left;
position: absolute;
top: 8px;
}
<div></div>
How can I apply border radius top left to above CSS triangle? It seem like impossible here.
CSS Syntaxborder-top-left-radius: length|% [length|%]|initial|inherit; Note: If you set two values, the first one is for the top border, and the second one for the left border. If the second value is omitted, it is copied from the first. If either length is zero, the corner is square, not rounded.
The border-top-left-radius CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner.
CSS Syntaxborder-radius: 1-4 length|% / 1-4 length|%|initial|inherit; Note: The four values for each radius are given in the order top-left, top-right, bottom-right, bottom-left. If bottom-left is omitted it is the same as top-right. If bottom-right is omitted it is the same as top-left.
border-width
on all the sidesborder-color
to top
and left
and set right
and bottom
transparent
div {
width: 0;
height: 0;
border-style: solid;
border-width: 55px;
border-color: #c00000 transparent transparent #c00000;
float: left;
position: absolute;
top: 8px;
border-radius: 10px 0px 0px 0px;
}
<div></div>
with box-shadow
you can use a pseudo element for giving a box-shadow
div {
width: 0;
height: 0;
border-style: solid;
border-width: 55px;
border-color: #c00000 transparent transparent #c00000;
float: left;
position: absolute;
top: 8px;
border-radius: 10px 0px 0px 0px;
}
div:after {
content: '';
position: absolute;
width: 1px;
height: 155px;
top: -55px;
left: 54px;
transform: rotate(45deg);
transform-origin: left top;
box-shadow: 2px 1px 6px 1px red;
}
<div></div>
Wrap it inside a parent div and give the parent border
http://jsfiddle.net/o6y997ds/
<div class="parent"><div class="div"></div></div>
.parent{
border-radius:10px 0px 0px 0px;
overflow:hidden;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With