C..
C..

Reputation: 7547

css everything on same line

I would like to know what is the easiest way to keep everything in the same line? all of my things are coming on top of each other

I put my 5 images in the same div but they still came on top of each other

Thanks!

Upvotes: 12

Views: 77659

Answers (4)

gearsdigital
gearsdigital

Reputation: 14205

If you set display: inline-block you can use the best from inline-level and block-level elements.

This means: Everything in one line but with the possibility to set a width or a height. Works on all elements like list entries or div elements. Not only images.

Upvotes: 2

Bazzz
Bazzz

Reputation: 26922

put a div around "everything" that should be on one line and give that div the following css:

everythingOnOneLine {
 white-space: nowrap;
}

everythingOnOneLine * {
 display: inline;
}

Upvotes: 16

Alain Pannetier
Alain Pannetier

Reputation: 9514

You probably mean

div img {
display:inline;
}

Upvotes: 4

Karel
Karel

Reputation: 2212

You can set the float style of your images to left:

<img style="float:left" src="" />

Upvotes: 3

Related Questions