I would like to create a button that has 2 slight wings either side but not completely sure how to achieve this shape and was wondering if anyone could offer some guidance?
I understand that I will need to use the before and after psuedos but unsure how to create that slight curve going into the main body of the button?
Taken from this site here.
You can create thate shape by using this:
Here is an example
If you want text, put text in the div and add to the css this:
However you'll need to do some fiddling to get it to the right width and height etc.
UPDATED EXAMPLE
LIVE DEMO
You can achieve that style by using
:before
and:after
. The trick is to skew the elements on the sides and apply a little border-radius for the smooth rounding, like this:Fiddle here: http://jsfiddle.net/JyhwZ/1/
To give the impression of a 3d plane rotating away from POV, like Star Wars opening crawls (recreated in svg too), use (prefixed) perspective and rotate3d (or rotateX).
To prevent aliasing, use an 1px transparent outline, as described here.
Running example
If you instead do not want the text to be rotated, apply the code above to the
::before
pseudo element, absolutely positioned relatively to its parent:Running example with non rotated text
Code: