Display Images Inline via CSS
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.
How do I get image and text to display inline?
Change the div class="rating" to a span class="rating" instead, Div is a block level element and will displace the element to the next line.
Span is not a block level element and will come beside the image.
How to use HTML/CSS to show images and titles inline?
Here. Proper HTML and CSS.
a {
display: inline-block;
text-decoration: none;
}
<div id="image">
<a href="file:///L:/file" title="Project Reports">New Reports<br>
<img src="http://tableau/" style="width:304px;height:228px;" />
</a>
<a href="file:///L:/file2">Project Reports<br>
<img src="http://tableau/" style="width:304px;height:228px;"/>
</a>
</div>
How do I display text inline with an image?
See this simplified snippet (remove border
s which are just for test):
#pic0txt {
display: inline-block; border:1px solid red;
text-align:center;
vertical-align:top;
width:48%;
}
#pic0img {
display: inline-block; border:1px solid red;
width:48%;
}
<div>
<div id="pic0txt">test</div>
<img id="pic0img" src="https://www-asp.azureedge.net/v-2016-11-01-012/images/ui/home-free-courses.png" />
</div>
<hr/>
<div>
<img id="pic0img" src="https://www-asp.azureedge.net/v-2016-11-01-012/images/ui/home-free-courses.png" />
<div id="pic0txt">test</div>
</div>
Related Topics
Can Xhtml and HTML Class Attributes Value Start with a Number
What Does the Clearfix Class Do in CSS
How to Achieve Curved Top Pointer
Crop Image Sides as Browser Width Decreases in Bootstrap Carousel
External Style Sheets, Specifying Absolute or Relative Paths
How to Increase Size of Serial Number in Ol
Double Dotted Border While Using Colspan
Float Multiple Fixed-Width/Varible-Height Boxes into 2 Columns
Why Are My Flex Items Not Wrapping
Div with Triangle at the Bottom with Background Image
Google Maps Shows "For Development Purposes Only"
CSS Table Td Width - Fixed, Not Flexible
Use Different @Keyframes Based on Parent Element Class
Float 2 Elements Side by Side Inside a Container Div
Add Padding to HTML Text Input Field
Why -Webkit-Transform: Translate3D(0, 0, 0) Messes Up with Fixed Childs