Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Padding issue when floating elements inside container

I'm trying to add vertical space between some sections of a page by adding a bottom padding to the section containers, but I can't get it to work. I assume that it has something to do with the fact that I've got un-ordered lists inside the containers and that the list items are floating (using float: left;).

I have also tried with margins and what not, but to no avail.

like image 893
Tom Avatar asked Dec 27 '22 09:12

Tom


2 Answers

Either float the containers left or set overflow to "auto." With either solution you will still need to set a margin to create the aforementioned spacing.

#developers, #contributors, #playtester {
  overflow:auto;
}
like image 71
mmwtsn Avatar answered Jan 12 '23 09:01

mmwtsn


Floating your containers left, as well, and then adding bottom margins should fix it

#developers, #contributors, #playtesters
{
    float: left;
    margin-bottom: 30px;
    ...
}
like image 37
Dominic Green Avatar answered Jan 12 '23 09:01

Dominic Green