Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display images in a row (HTML)

Tags:

html

image

row

So I have this very simple HTML page. All I want is to display images in one long row. What is the simplest way, that would work on all browsers?

<html>
<head>
<title>My title</title>
</head> 
<body>
<div id="images">
<img src="1.jpg">
<img src="2.jpg">
<img src="3.jpg">
<img src="4.jpg">
<img src="5.jpg">
<img src="6.jpg">
</div>
</body>
</html>
like image 755
user2757799 Avatar asked Sep 07 '13 21:09

user2757799


People also ask

How do I put an image in a row in HTML?

Place Images Side by Side using CSS Float To give the spacing between the side-by-side images we will use the padding property. For example, if you want only two columns inside the row, use width: 50%; . Similarly, for three columns, use width: 33.33%; , for four columns width: 25%; and so on.


1 Answers

If you want #images to be a single row, you can turn off word wrapping.

#images {
    white-space: nowrap;
}

JSFiddle

like image 78
Austin Brunkhorst Avatar answered Nov 13 '22 10:11

Austin Brunkhorst