Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Cascading Style Sheets _ Layout with columns?

Posted by: sajox Jul 4 2020, 12:25 AM

Hello everyone. I have a question in the area of CSS. When I create page layouts using columns I have a problem. It never shows up nicely in browsers. There is always some margin that is not even written in the code and various other problems. Even when I copy code from the internet. What is your suggestion? Should I use Bootstrap or something else?

Posted by: pandy Jul 4 2020, 02:08 AM

QUOTE(sajox @ Jul 4 2020, 07:25 AM) *

Hello everyone. I have a question in the area of CSS. When I create page layouts using columns I have a problem. It never shows up nicely in browsers. There is always some margin that is not even written in the code and various other problems. Even when I copy code from the internet. What is your suggestion?


Where do you see the margins? If they are around the page it's the default padding browsers add to BODY. Some earlier browsers used margin. I'm not sure if it's still necessary to take that into account, but I use the below line out of habit.

CODE
body   { margin: 0; padding: 0 }


If that's not the problem, please explain further or show us an example.

QUOTE

Should I use Bootstrap or something else?


No. Don't add more to the mix until you can handle the mix you already have. But that's my opinion.

Posted by: Christian J Jul 4 2020, 06:18 AM

Many HTML elements have default margins as well: https://www.w3schools.com/cssref/css_default_values.asp

Note that default styles may not be exactly the same between browsers: https://bitsofco.de/a-look-at-css-resets-in-2018/

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)