How to make this button is CSS with Angled , Drop shadow, Inset shadow with flexibility in width?
I've tried to make it here http://jsfiddle.net/jitendravyas/6RsnN/ but don't how to give angle to it and how to create cut-out border around it.
And button should be flexible in width.
I'm only making this for iphone so full CSS3 is allowed.
The final result is:
pure css blue button http://img832.imageshack.us/img832/8258/664d7b5656434db68cbee8b.png
Demonstration of flexibility:
This button can be pure
CSS
only with a lot of extra markupwith this markup:The main trick for creating triangles with box-shadow includes several steps:
Step 1. Create element '.triangle' - it will be a wrap for real triangle.
Step 2. Apply

position: absolute;
, fix itswidth
andheight
:red background-color is onle for demo
Step 3. Create big square element '.triangle::before' — it will be 'real' triangle after step 6
Step 4. Turn it 45 degrees (
transform: rotate(45deg)
).Step 5. Add box-shadow.

The result after step 3 is:
Step 6. Add

overflow: hidden;
Ta-dum!On
.tag_inner
use the same trick, butbox-shadow
should be notinset
but normal.Notice, that if you will use this trick always check what
vendor
prefixes must be used and place property without prefix on the last place.Update: Make markup more semantic — only one element for triangle trick.