Live data from Hacker News

The complete guide to centering a div

tipue.com

81–90 of 170 posts

Re: The complete guide to centering a div

#81

Whenever 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?

> With tons of comments and discussion too To be fair, the majority of comments tend to either be ones like yours, or ones elaborating on the "CSS is somehow well-designed" front. As others have noted, tools like flexbox make what the article is trying to accomplish easy. The issue is that lots of users run really old browsers, so if you want a single solution across your user population, you're going to have to reso…

>It's silly to say that "nothing has changed", when what you're really saying is...

I don't see the GP comment saying that, what are you respondng to?

Re: The complete guide to centering a div

#82

Whenever 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?

Obligatory:

http://4.bp.blogspot.com/-E6ukbgTm5iM/Um0CrEtzXSI/AAAAAAAAG_...

Re: The complete guide to centering a div

#84
post #83

.... will not work?

> This feature has been removed from the Web. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ce...

Re: The complete guide to centering a div

#85
post #84
post #83

.... will not work?

> This feature has been removed from the Web. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ce...

It also won't work because controls text alignment and will have no effect on the alignment of a div (it will center its contents, though) (also this isn't entirely true, centering text will also center divs in IE6 and earlier).

Re: The complete guide to centering a div

#86
post #62

Earlier 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.

Generally I agree that too many people have a fetish about avoiding tables when it's clearly the right tool for the job. But I've definitely been bitten by using them. Table layouts don't play well with other CSS properties.

Re: The complete guide to centering a div

#88
I've been working on this form with php [1]. Only positioning I've tried so far is using tables. Focusing on functionality for now, figure I can just wait til it works to make it look pretty. Haven't really worked to understand CSS since I was in middle school in the late 90s.

[1] http://i.imgur.com/eRbSdbT.png

Re: The complete guide to centering a div

#90
The Web Styling Challenge: you and another person are going to make a web site. You are doing the HTML, while the other person does the CSS (you can discuss it and swap jobs if you want). You can talk as much as you want ahead of time, but the only record you can keep is a table that maps CSS selectors to a description of what you'll be using them for. You are then split up and do your individual tasks. When you're finished, you will be judged on how broken the results of combining your pages with the other person's stylesheets are. I think just imagining how this game would go makes it pretty clear that CSS is lousy at separating the concerns of style and layout.
Post reply on HN