I'm wondering if there's an "easy" way to do something like below using CSS3, I want to avoid using images and absolute positioning, or similar, and would prefer to use some CSS method to achieve this.
I would also like to avoid using any fixed heights for this style too, since I'll be using the same style on various elements that all vary in size and colour.
I needed to do this for each of the headers in my 3 column row and I only needed a cut out on one side. None of these answers worked for me so I came up with this.
CSS
Fiddle Demo
This allows your cut-out areas to be transparent:
HTML
CSS
Updated Fiddle w/ background image to show trasparency: http://jsfiddle.net/Eg9jF/1/
You can do it using CSS3 gradients for support in most modern browsers:
Demo
(You may run into this problem, but you can read how to solve it.)
You can use a simple clip-path in the CSS:
Result (in Chrome):
ONLINE DEMO
But be aware of that the support isn't that great yet for all browsers. Currently it does not work in FF as far as I can tell (I believe you can use SVG for FF instead).
Update
Ok, after playing around with SVG (I'm no expert on SVG) I came up with a "prototype" that works in FF:
In HTML:
Then set its ID as clipping path in CSS:
And it will produce this in Firefox:
(fiddle updated with this code)