CSS - Test Your CSS Skills Number 28 (max-width)
CSS - Test Your CSS Skills Number 28 : Quiz now ended - Solution in post #38
Just as you are recovering from the last mammoth quiz, please don't rush to put your braincells away just yet as I have another CSS myth to squash.
Once the element is at 800px width it should then be centred in the viewport if the viewport is wider. This would be the same as setting max-width of 800px and using margin:auto.
I should also point out that I'm not looking to mimic this type of behaviour as follows.
The element .test should be content width and then get capped at 800px width.
Look at the attachments which show working examples of max-width in action in IE6.
The answer is relatively simple and took me about 10 minutes to work out but then I may just have been lucky as google shows no results for this at all :)
The basic rules are:
No expressions/behaviours etc
no conditional comments in the body of the html
Try to keep the code as simple and usable as possible and the look as close to my original as you can (which is shown in the attachment).
Any questions or if anything is unclear just ask and remember this is just for fun :) (although this solution will indeed be a very workable solution for IE6)
Solutions to the quiz will be posted at the end of the week (or longer) depending on how it goes :)
Have fun .
PS. : In case you missed the other tests you can find them all listed here: