...maybe that the reason for all of this is that the CSS API (box model ..., box properties ...) is too complex and as a result browser implementations tend to f* it up easily.
The complete guide to centering a div
121–130 of 170 posts
Re: The complete guide to centering a div
#122...maybe that the reason for all of this is that the CSS API (box model ..., box properties ...) is too complex and as a result browser implementations tend to f* it up easily.
Re: The complete guide to centering a div
#123Earlier quoted context omitted.
Right, to me plain HTML tables are great for overall master page layout yet it seems everything I've read and the few web geniuses I've met will deride using them over CSS.
Same here. It's amazing how convoluted "modern" CSS can be compared to simple, reliable tables.
Re: The complete guide to centering a div
#124Re: The complete guide to centering a div
#125Re: The complete guide to centering a div
#126I don't know anything about the history of CSS's design, but I'm perpetually amazed that positioning (and specifically centering) requires so much CSS magic. I would think CSS positioning would be a one-liner, but instead it's a collection of context-dependent, browser-dependent recipes. I wonder if there's a good reason for the madness, or if it's just poor design. (FWIW, I'm a backend engineer and have only dabbled…
The thing that boggles my mind is that we're over ten years and three major versions in and we can't center stuff reliably or conveniently, images won't scale up to fit (only down...), multi-column text is barely implemented and Google is ripping it out, the box model is borked by default, it's non-trivial to determine the layering of UI elements, and so on. It's amazing that we get solutions for things that no-one r…
img { width: 100%; }
multi-column text is barely implemented
columns: 3 [1]
Google is ripping it out
No, they’re not. You’re thinking of CSS Regions?
the box model is borked by default
It’s different to what you’re expecting by default, and you can flip it to your required behaviour with a single switch.
it's non-trivial to determine the layering of UI elements
Fixed z-index? And if you’re concerned about different stacking contexts, they solve a problem in themselves.
[1] If you don’t care about IE8+9 http://caniuse.com/#feat=multicolumn
Re: The complete guide to centering a div
#127Earlier quoted context omitted.
That this is missing is surprising. This method is the most compatible across browsers and only real drawback is the additional markup.
Well, of course it comes with gotchas: - if that item is "display: table-cell", it must be within a larger element that's "display: table" or "display: table-row" - "vertical-align: middle" works also for inline-block elements, but that means it's subject to all the other gotchas present in the article about explicit sizing It eventually makes a kind of sense , but these rules are passed down in folklore and trial-an…
Re: The complete guide to centering a div
#128Whenever anybody says that CSS is easy, or "of course you can do that with CSS", or even hints that CSS is somehow well-designed... ...the only thing I really need to say, is that every couple months, on Hacker News, where a lot of really smart people hang out, a new top-voted story comes up about how to center a div . With tons of comments and discussion too. And it's not even a joke. What more is there to say?
CSS has two faces, the awesome "You can make amazing things with ease" face and the "It won't do what I want unless I create some cludgy arrangement of elements in order to attach a combination of weird properties" Those two faces are because of two simple facts. 1. CSS is a really good way to set properties. 2. The properties are shit. The part of the properties that is most gloriously broken for layout is that the…
Re: The complete guide to centering a div
#129Earlier quoted context omitted.
The browser your employer ships only currently has partial support for flex box. Why do Mozilla employees insist on being misleading about Firefox's standards support? Flex box is not ready for mainstream use. Not just because of 'old browsers', because of your current browser. https://bugzilla.mozilla.org/show_bug.cgi?id=702508 this won't be in the stable release for a couple of months. See http://caniuse.com/#searc…
You have been able to center stuff using flex box for years in Firefox.
Re: The complete guide to centering a div
#130Earlier quoted context omitted.
I may be using words incorrectly, and I'm not positive you can even make the distinction, and I am happy to stand corrected, but it always seemed to me that CSS was fine for style , but terrible for layout . So I think I'm agreeing with you.
Right, to me plain HTML tables are great for overall master page layout yet it seems everything I've read and the few web geniuses I've met will deride using them over CSS.
I just hate the part where they act like CSS is a good alternative in practice.