renilative
renilative

Reputation: 159

How position divs horizontally inside another div

I have a php script that is generating an unspecified number of divs inside another but by default the divs are being vertically aligned as in one of top of the other though their widths can allow for them to be horizontally aligned. How can i go about this?

Upvotes: 0

Views: 918

Answers (2)

Lukas Huzen
Lukas Huzen

Reputation: 183

div > div{
display: inline-block;
}

Upvotes: 4

Headshota
Headshota

Reputation: 21449

float them to left

float:left;

or give them inline display mode.

display:inline;

Upvotes: 2

Related Questions