I was wondering, what is the best way (using html, css, and graphics) to create a web page whose top header section appears to be beveled, as opposed to straight across? Please see the below image as an example:
I'm not sure how to use images in a way such that they would expand/contract in accordance with different browser sizes/resolutions...
Can anyone offer me some help? Or perhaps point me to a resource?
Thanks!
Mine is a cleaner version of @Alex's:
Live Demo
It obviously won't work in IE.
Here's a cross-browser version, which i made with help of jquery. Basically, the script creates many spans, with white background and decreasing width.
You can play around with
STEPS
andFACTOR
variables, which will change the result. The step function sets the easing of the curve. You may replace it later with better functions than mine, it's just an example.You can find the entire code (html + css on the Fiddle)
Here is another way of achieving this.
width
andheight
larger than element itself.border-radius
to create round effect andbackground-color
.overflow: hidden
on parent to hide excess part.Output Image:
You could use CSS3 or webkit-specific properties, but this is not well supported as far as cross-browser compatibility is concerned. If you want to support as many browsers as possible, your best bet would be to use a background image to achieve this effect.
You could use
border-radius
.See my example on jsFiddle.