Doing it with style
A Mad Tea-Party
There was a table set out under a tree in front of the house, and the March Hare and the Hatter were having tea at it: a Dormouse was sitting between them, fast asleep, and the other two were using it as a cushion, resting their elbows on it, and talking over its head.
Fails in IE - though can be made to work with javascript. Works in IE7.
A Mad Tea-Party
There was a table set out under a tree in front of the house, and the March Hare and the Hatter were having tea at it: a Dormouse was sitting between them, fast asleep, and the other two were using it as a cushion, resting their elbows on it, and talking over its head.
Works in all browsers. Cheating really as this is not opacity.
A Mad Tea-Party
There was a table set out under a tree in front of the house, and the March Hare and the Hatter were having tea at it: a Dormouse was sitting between them, fast asleep, and the other two were using it as a cushion, resting their elbows on it, and talking over its head.
Fails in IE - see method 2. Works in IE7.
A Mad Tea-Party
There was a table set out under a tree in front of the house, and the March Hare and the Hatter were having tea at it: a Dormouse was sitting between them, fast asleep, and the other two were using it as a cushion, resting their elbows on it, and talking over its head.
This is a very old demo that is kept on site for those starting out with CSS.
Placing text over an image can sometimes make it difficult to read, but with these methods the background for the text is made 'opaque' using various methods of opacity (including css3) and the black text is then quite readable.
Note that I have used two 'text' divs for method 1. One to hold the background opacity and the other to hold the text. If the text was placed in the same div as the opaque background then it too would become opaque.
Only one text div is required for methods 2, 3 and 4.
5th September 2006
Works in Internet Explorer 7 (RC1).
Your donations keep CSS PLAY running.
If your donation is for the use of a demo then please email me with the demo url after making your donation.