Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Some issues about relation between width/height and margin/padding/border Reply To: Some issues about relation between width/height and margin/padding/border

#193143
spz1st
Participant

It depends on how you view the element. You can view the element as an area where you display contents (text, image, etc.) in certain ways, such as with or without a margin, a border, and/or a padding. Then width and height are used to set the size of the area (element).

Had margins been included in width and height from the begin, a css type (say such as “float: 0 center;”, or use placement instead of float) could have been defined to achieve what current “margin: 0 auto” may achieve.

I like to add that the current way of rendering with respect to width/height and margin/padding/border is not only counterintuitive, but also makes it harder, if not impossible, to get a desired layout.