I haven't seen so much nay-saying on HN in a while. It's like because there's an artistic element this or it's pure-web tech the appreciation of a cool hack and interesting exploration of a technology is completely gone. This is a classic example of a "hack", pushing CSS slightly beyond what it was intended for and potentially what is practical. But it's beautiful and clever, and if you truly can't appreciate it, tha…
Scanning through the comments, it looks like most of the naysaying was downvoted and the comments about how it's neat floated to the top, including yours.
A Single Div
101–110 of 146 posts
Re: A Single Div
#102I haven't seen so much nay-saying on HN in a while. It's like because there's an artistic element this or it's pure-web tech the appreciation of a cool hack and interesting exploration of a technology is completely gone. This is a classic example of a "hack", pushing CSS slightly beyond what it was intended for and potentially what is practical. But it's beautiful and clever, and if you truly can't appreciate it, tha…
Scanning through the comments, it looks like most of the naysaying was downvoted and the comments about how it's neat floated to the top, including yours.
Re: A Single Div
#103Interesting to see CSS coming into it's own. Sure it's not the most practical thing at the moment, but I could certainly see some smaller-scale uses being useful today (like iconography and such). Makes me wonder if we'll begin to see icon/image libraries released with pure css versions.
The whole "[something] in pure CSS" began when people realized how awful table-based layouts are. First it was layouts, then full-blown designs.
This is almost like the most extreme version of that trend, almost to the point of parody.
Re: A Single Div
#104Earlier quoted context omitted.
> But it's beautiful and clever, and if you truly can't appreciate it, that's sad. Interesting. Is it as sad as the fact that one still cannot vertically center a div in CSS without using elaborate hacks?
What constitutes an elaborate hack? You can do it with a hack, but it isn't really elaborate. Put the div in an outer div. The outer div has `display: table-cell` and `vertical-align: middle`.
Also you might want outer div to fit the space it lies in and height: 100% does not always work.
Basically somewhere around transition from IE to Firefox and from transitional to strict DOCTYPE tables were broken beyond repair for layout purposes. We have not recovered since. Flexbox brings some hope but not necessarily salvation.
Re: A Single Div
#105Earlier quoted context omitted.
I believe Flexbox, which is supported by most major browsers, allows vertically centering content without hacks: http://philipwalton.github.io/solved-by-flexbox/demos/vertic...
http://caniuse.com/#feat=flexbox Until most IE users upgrade to 11, it's not usable by those of us who can't exclude a large chunk of our users.
Re: A Single Div
#106Earlier quoted context omitted.
I think this kind of thing isn't born out of necessity, since we're locked in with the tech, but more because its a challenging experiment that requires some pretty clever CSS to accomplish. You should certainly not do this in the wild.
I didn't mean that this is done out of necessity , I mean people only give a half-baked mess of standards that is modern web-layout/css the time of day because it's foisted upon us. If CSS were just another layout engine for just another platform, people would laugh it out of the room and not bother with this kind of artistic stunts. CSS does not deserve the kind of respect that would go into this sort of craftmanshi…
Re: A Single Div
#107I am unmoved by the many "... in pure CSS" posts, but I guess they are the equivalent of "HTTP server in x86 assembly" for CSS designers.
I like this, it's neat art. However I must agree that I'm unmoved, I invite anyone who thinks this is particularly clever to visit www.pouet.net for a bit of re-calibration. It's all relative.
Re: A Single Div
#108Re: A Single Div
#109Earlier quoted context omitted.
I believe Flexbox, which is supported by most major browsers, allows vertically centering content without hacks: http://philipwalton.github.io/solved-by-flexbox/demos/vertic...
http://caniuse.com/#feat=flexbox Until most IE users upgrade to 11, it's not usable by those of us who can't exclude a large chunk of our users.
Re: A Single Div
#110I haven't seen so much nay-saying on HN in a while. It's like because there's an artistic element this or it's pure-web tech the appreciation of a cool hack and interesting exploration of a technology is completely gone. This is a classic example of a "hack", pushing CSS slightly beyond what it was intended for and potentially what is practical. But it's beautiful and clever, and if you truly can't appreciate it, tha…
> But it's beautiful and clever, and if you truly can't appreciate it, that's sad. Interesting. Is it as sad as the fact that one still cannot vertically center a div in CSS without using elaborate hacks?