by rangerpolitic · 7y ago · 0 comments
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.
I keep hearing about this mythical beast, and yet I have never seen one beyond the simplest of text-only blogs.
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.
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.
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.