Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display Images Inline via CSS

Tags:

I have three images that I want to display in a single row next to each other.

Here is the HTML:

<div id="client_logos">
<img style="display: inline; margin: 0 5px;" title="heartica_logo" src="https://s3.amazonaws.com/rainleader/assets/heartica_logo.png" alt="" width="150" height="50" />
<img style="display: inline; margin: 0 5px;" title="mouseflow_logo" src="https://s3.amazonaws.com/rainleader/assets/mouseflow_logo.png" alt="" width="150" height="50" />
<img style="display: inline; margin: 0 5px;" title="piiholo_logo" src="https://s3.amazonaws.com/rainleader/assets/piiholo_logo.png" alt="" width="150" height="50" />
</div>

Here is the CSS:

#client_logos { display: inline-block; }

For some reason, it only displays two logos next to each other. Not sure what's wrong. Any ideas?

URL: http://rainleader.com/who-we-are/

See screenshot.enter image description here

like image 680
Trent Scott Avatar asked Nov 07 '12 04:11

Trent Scott


People also ask

How do I make an image display inline CSS?

How Do I Inline Text An Image? Place the text next to an image in HTML by calling CSS Property on Image. Type a text next with your image in HTML using Display: inline-block and vertical-align: top.

How do I view an inline image?

Use F10 or alt+v to make a menu appear and in that menu go to View|Toolbars and tick the checkboxes. Now you have a menu with a View option, you can use it to display attachments inline, and also to view messages in "original html".

How do you align images in CSS?

To center an image with CSS Grid, wrap the image in a container div element and give it a display of grid . Then set the place-items property to center. P.S.: place-items with a value of center centers anything horizontally and vertically.


2 Answers

You have a line break <br> in-between the second and third images in your markup. Get rid of that, and it'll show inline.

like image 71
Matthew Blancarte Avatar answered Sep 19 '22 16:09

Matthew Blancarte


The code you have posted here and code on your site both are different. There is a break <br> after second image, so the third image into new line, remove this <br> and it will display correctly.

like image 41
pkachhia Avatar answered Sep 19 '22 16:09

pkachhia