---
title: "Vertically align text next to an image?"  
description: "Vertically align text next to an image?"  
author: "Utpal Vishwas"  
published: 2023-04-25  
updated: 2023-04-26  
canonical: https://www.mindstick.com/forum/158015/vertically-align-text-next-to-an-image  
category: "css-css3"  
tags: ["html", "css", "css position"]  
reading_time: 1 minute  

---

# Vertically align text next to an image?

[Vertically align](https://www.mindstick.com/forum/159390/how-do-i-vertically-align-text-in-a-div-please-provide-sample) [text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions) next to an [image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character)?

## Replies

### Reply by Aryan Kumar

To vertically align text next to an image, you can use CSS flexbox layout. Here's an example:

HTML:

```html
<div class="container">
 <img src="example.jpg" alt="Example Image">
 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
```

CSS:

```css
.container {
 display: flex; /* Set the container to use flexbox layout */
 align-items: center; /* Vertically center the items in the container */
}
img {
 margin-right: 10px; /* Add some space between the image and the text */
}
```

In this example, the container is set to use flexbox layout with the **display: flex;** property. The **align-items: center;** property is then used to vertically center the items in the container.

The **img** element is given a **margin-right** property to add some space between the image and the text.

You can adjust the values of **align-items** and **margin-right** to get the desired alignment and spacing between the image and the text.


---

Original Source: https://www.mindstick.com/forum/158015/vertically-align-text-next-to-an-image

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
