See this image
or here http://cl.ly/image/0a2R2V0C1y2l
We have a div that uses this image as background-image
.header_background{
display: inline-block;
position: relative;
top: 10px; left: 0; right: 0; bottom: 0;
background-image: url(../img/header-back.png);
height: 47px;
width: 899px;
float: right;
}
It has rounded corners and gradient.
We will be putting in other html like text, more div elements and image buttons inside the div.
Is there a way for me not to use an image for the speech bubble but use html5/css3 techniques?
Check this live demo
And here is the code:
I’ve used this online gradient maker tool, css arrow please and modified a little bit.
data:image/svg+xml;base64,...etc...is an inline SVG image, encoded on base64. This will render the gradient on IE9, which doesn’t support any pure CSS3 gradient feature.Actually it is supported by other modern browsers (FF13+, Opera12+), but as Lea Verou reported it’s slower than pure CSS3 gradients, that’s why you still need the other declarations.
For IE8, you can use a gradient filter:
Which is pretty straight-forward (
GradientType=0means vertical, if you change it to1you’ll have an horizontal gradient). The problem is that it’s supported by IE9 too! So to avoid overlapping you need to use conditional comments.In this specific case i suggest you … to not give a damn about IE8. It’ll just display a white background (that’s why i added
background:#FFF;as the first declaration) which is totally fine.