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

#193154
spz1st
Participant

As I said earlier that it depends on how you view/define an element. If an element had been defined as an area to display something in certain ways and width and height were defined to set the size of the area, then margins could be part of width and height because width and height here were used to set the size of the area, not the size of the content per se. Then within the area, you could set the margin, border, and/or padding for the content to be displayed in the area. Certainly I’m not seeking to redefine the element, width/height, margin now. But I do hope to have a new css type to direct the browser to include margins in width/height. When you design a web page, it’s so natural to just set width and height first for various elements to get the desired layout (you can set the background of the elements with different colors to visualize them). Once you get the layout worked out, you will begin to style each element one by one. But currently you can’t style individual elements without having to worry about ruining the original layout (sometimes you have no way to prevent it) and you have to change width/height every time you set/change the margin for an element. If margins were included in width/height, you wouldn’t have such problem and the page setting would be much simpler and easier.