Hacker News new | ask | show | jobs
by rangerpolitic 2578 days ago
> Did you miss the 5-10 years during which every CSS designer tortured themselves replicating tables with floats?

I never really understood why people had such difficulty with this. I was able to execute table-less layouts while still supporting IE5 on Mac.

> To this day, changing a site's entire design without touching its markup is a mirage.

That's only because HTML authoring is dead. No one writes HTML well these days. Just look at tools like Elementor. How many nested divs do you need to add a faux button to a website? It's ridiculous.

Write well-structured, semantic HTML being mindful of a separation of concerns, and flipping between stylesheets is a piece of cake.

2 comments

> Write well-structured, semantic HTML being mindful of a separation of concerns

I keep hearing about this mythical beast, and yet I have never seen one beyond the simplest of text-only blogs.

You don't see it because either (a) people don't do it or (b) people are using HTML as a markup language for apps rather than documents.

HTML was created to be used for documents. It was coopted to be used for apps. They really should have come up with a different language for apps.

Why people don’t use it in a) would be an interesting discussion. And I fully agree on b): HTML (+ CSS) is wholly inadequate for app development.
Can you give us a link to your elegant table-less IE5 supporting website? I would like to see how you achieved it.

I lost a lot of hair trying to make a simple 3 column layout where the middle column would scale to the width of the window and could consist of multiple DIVs in a vertical row, all of the same width. AKA "baby's first blog" layout. Something that should have been one of the design cases for CSS.

> Can you give us a link to your elegant table-less IE5 supporting website?

I cannot. They no longer exist. This was 14 years ago. I left web development shortly afterwards.

For your example, horizontal alignment was easy. One container div with a width of 99.9% and a left/right margin of auto. Inside you place three divs (columns) with a width of 33.3% and float left. Add another div at the end to clear the float.

Vertical alignment required a "hack."

http://www.greywyvern.com/code/min-height-hack

And to be clear, I never called it "elegant." I simply suggested it was possible.

Should CSS have been better? Sure. But, by that measure, it still sucks today.

You don't want the sidebars to scale with the screen though, just the middle. And as I recall the obvious solution of just setting a fixed width on the two outer divs and letting the middle one autoscale didn't work for some stupid reason. Maybe because they scaled to the content, not the width of the remaining space.