This question already has an answer here:
- Shape with a slanted side (responsive) 2 answers
In css can i rotate the border alone, instead of rotating the whole element? something like this:
I basically wanna create a slanting border for my video player.
I wanna do something like the accepted answer of this post: click here
except that instead of slanting the top and bottom it slants only the right side.
I've tried this, but it slants both left and right sides:
html:
<div class="skew-neg">
<p>Hello World.</p>
<p>My name is Jonathan.</p>
<p>This box is skewed.</p>
<p>In supported browsers.</p>
</div>
css:
html {
background: #FFF;
color: lightblue;
font: 16px 'Arial';
line-height: 150%;
}
div {
background: blue;
margin: 50px auto 0;
padding: 20px;
width: 200px;
box-sizing: border-box;
box-shadow: 0 0 20px rgba(0,0,0,.9);
border-radius: 25px;
}
.skew-neg {
-webkit-transform: skewX(-50deg);
-moz-transform: skewX(-50deg);
-ms-transform: skewX(-50deg);
-o-transform: skewX(-50deg);
transform: skewX(-50deg);
}
.skew-neg > * {
-webkit-transform: skewX(50deg);
-moz-transform: skewX(50deg);
-ms-transform: skewX(50deg);
-o-transform: skewX(50deg);
transform: skewX(50deg);
}
Follow here to solve this problem :)
click here
Hopefully it can help you
What you can do is something like this: http://jsfiddle.net/py9Ze/
HTML:
CSS:
Basically put a border around the parent container and rotate it
x
degrees, then rotate the child-x
degrees.PS I am behind a firewall so I cant see the image you posted so this might be way off from what you wanted.
You could try using CSS Generated Arrows. Here is an overview of how to create and use them.
I don't believe this is the solution, BUT it could be one of them. You might find the trick helpfull.
Best
A solution that require JavaScript and canvas, but offers great versatility -
Result:
ONLINE DEMO
Code:
The add this for creating the rounded rectangle (with mod. for skew):
Then you just call this function with ID of element, border width and how many pixels you want to skew the right side with: