3 ms·
Today, many people want to modularize components/elements for placement in an arbitrary way. That is, they want to be able to plunk down an element on any page
by sureaboutthis 8y ago
Today, many people want to modularize components/elements for placement in an arbitrary way. That is, they want to be able to plunk down an element on any page and make it all work together. However, if one uses 'width' as the total width of the element, including margin, borders and padding, it could mean the spacing between the content, pre-arranged in that way, may not fit the design of the page giving it too much margin or padding making it look awkward. Then the designer is stuck with that if he doesn't have access to changing the elements margin/padding.
If `width` only means the content, then a designer can plunk that same element down and adjust padding/margin to fit any design easily.
This is one example of an issue others would complain about.
- bunderbunder 8y agoThese kinds of tradeoffs can be handled better, though. It's worth taking a look at how Windows Presentation Foundation does things, for example. It places the decision of whether to size individual elements according to their content size, the size of the container they're being placed into, or their total width front and center, in a way that, IMO, leads to less head scratching and compromises. I think the issue here is that CSS was originally envisioned primarily as a styling tool, and layout functionality was bolted on as an afterthought, through a design-by-committee process. So, yes, it works, and anyone can learn it, but it would be nice if the overall effect were one of a technology that had a clear plan all along.