Q8. There's a fire starting in my heart.
The Scenario
Use only this markup:
The Challenge
Style the div to:
- be 100px square
- have the text in the exact middle, both vertically and horizontally
- have a background that fades from red at the top to yellow at the bottom, or be solid yellow in browsers where this is not possible
Considering this area of CSS3 is still being finalized, your solution should be mindful of future developments and forthcoming standardization.
In should look like this in Chrome 13, Safari 5.1, Opera 11, Firefox 6 and IE10:

And this in IE9, Chrome 9, Firefox 4 and below:

You can use a browser to test your work.
You can not change the markup.
You can not write any script.
How to Play
Post your CSS as a comment. Comments will be held in the moderation queue until the answer is posted. Full answer and explanation will be appended to this post around 72 - 96 hours after the question is posted. Update: answer now posted.
If you don't want your answer public, please post a comment like 'playing at home' so I can at least guage how many people are participating and whether the questions are useful.
Follow @cssquiz to know when the answer is up and to catch the next question.
(The title is a reference to Adele's Rolling In the Deep.)
This question required the use of CSS3 gradients. The curently released versions of Chrome, Safari, Opera and Firefox all support them via vendor prefixes. Internet Explorer is playing catchup in IE10.
Here's the CSS I used:
I achieved vertical positioning of the text using a line height that matched the element height. Most of the responses used display: table-cell. The latter approach is definitely more reliable, and would work with multiple lines of text (line heights wouldn't). The downside though, and the reason I stuck with line heights instead, is that display: table-cell isn't supported in IE7 or below.
As you can see, there are numerous gradient syntaxes currently working in the wild. To reliably target each different implementation we use vendor prefixes. Ordering is important, such that the W3C proposed syntax comes last. This way, an implementation that is considered standards-compliant will always use the standard-based rule.
Particularly for gradients, it's currently easiest to use a tool to generate them. I used the IE team's tool.
A number of the responses used IE's proprietary filters feature to supply the gradient to IE6 through 9:
I opted to use a fallback color instead for these browsers as IE filters generally have annoying flow on consequences such as changed font rendering. If you absolutely had to get the gradient into these browsers, I'd generally still prefer to try and use an image myself.






