3 ms·
It's amazing how CSS lets you do stuff like this but still can't center things easily. Nice demo by the way, but why on earth did you use an id rather than a c
by Tloewald 12y ago
It's amazing how CSS lets you do stuff like this but still can't center things easily.
Nice demo by the way, but why on earth did you use an id rather than a class?
- masklinn 12y ago> It's amazing how CSS lets you do stuff like this but still can't center things easily. It's trivial to do if you can use flexbox. And I do mean trivial, we're talking 3 properties including "opting into" flexbox: http://jsfiddle.net/1vd9xLdy/ http://jsfiddle.net/1vd9xLdy/ (note: didn't bother with prefixes or older syntaxes so IE >= 11, Firefox >= 28, Chrome >= 29, Opera 12.1 or >= 19)
- Tloewald 12y agoIt's not vertically centered in the window, and that's using a CSS feature that's only fully-supported in IE11. This trickery is all box shadows and border radii, which go back to IE8. Flex box is great, but it's interesting that CSS implemented gaussian blurred inset shadows and 3d transforms before it addressed centering (incompletely).