Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css everything on same line

Tags:

css

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!

like image 498
C.. Avatar asked Feb 08 '11 14:02

C..


4 Answers

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;
}
like image 133
Bazzz Avatar answered Oct 19 '22 20:10

Bazzz


You probably mean

div img {
display:inline;
}
like image 38
Alain Pannetier Avatar answered Oct 19 '22 18:10

Alain Pannetier


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

<img style="float:left" src="" />
like image 44
Karel Avatar answered Oct 19 '22 19:10

Karel


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.

like image 2
gearsdigital Avatar answered Oct 19 '22 19:10

gearsdigital