Categories: Css

Align text vertically next to an image

Share

Need to Align text vertically next to an image? Here is a simple way to align text vertically that is also next to an image.

Actually, this is quite simple. Apply the align to vertical to the image. Since it is all in one line, so, this is really the image that you want aligned rather than the text.

Suppose, you have a image tag and a text next to the image. So, wrap both within a div.

For example, you have below image tag:

<img src="image.jpg">

And a text:

<span style="">This is working</span>

Read Also: Horizontally center a div within a div

So, wrap both in a div and apply the below css rule.

<div>
<img src="image.jpg" style="vertical-align:middle;">
<span style="">This is working</span>
</div>

Result:

Recent Posts

Overview of Reputation, Services, and Features of IplWin

IplWin stands as a reliable and enthralling platform for Indian punters, offering a captivating blend…

1 day ago

Blogging Brilliance: Driving Traffic and Engagement with Quality Content

Introduction In today's online age, consumers are constantly bombarded with information. They crave valuable content…

2 days ago

How Assisted Living Gives Seniors More Freedom

In today’s rapidly aging society, finding a living situation that provides older adults with both…

2 days ago

Should you go for a Refurbished Mac?

If you wish to purchase a Mac, then it is strongly suggested to consider purchasing…

2 days ago

How Many Types of Bits are Used in Drilling Operations?

Oil drilling is a complex process that involves several components, including the drilling bit. The…

3 days ago

Best Watches to Match Your Business Look

Watches can be more than a fashion. They can be a symbol, especially in the…

3 days ago