How to make a box with arrow in CSS?
Making round corner is easy. but any idea to make the arrow on left side without using image.
Is it possible to make possible with
only one elements <p>....</p>
body { background: #ff004e; padding: 40px } p { background: white; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; width: 250px; height: 150px }
<p></p>
Arrows. To create a simple arrow without a tail, make a box with a width and height, border, as well as zero left and top borders. To make an up arrow, add the transform: rotate(225deg); property, and to make a down arrow, add the transform: rotate(45deg); property to rotate the arrow to 225 and 45 degrees respectively ...
Like this :
.arrow { border: solid 10px transparent; border-right-color: #FFF; }
Demo : http://jsfiddle.net/sparkup/edjdxjf2/
UPDATE :
It can also be achieved without empty elements with the css property :before
element:before { content: ""; position: absolute; top: 50%; // half way down (vertical center). margin-top: -15px; // adjust position, arrow has a height of 30px. left:-30px; border: solid 15px transparent; border-right-color: #FFF; z-index: 1; }
Demo : http://jsfiddle.net/sparkup/y89f1te0/
hope it helps
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