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

Recover From Google Penalties in 10 Steps in 2024

Facing Google penalties can be a daunting challenge for businesses relying on organic search traffic.…

18 hours ago

What is the Future of Artificial Intelligence?

Technology, undeniably, has made our lives easier. But the advent of artificial intelligence has been…

21 hours ago

Role of guest post services in SEO

Guest post services have become an essential tool for businesses and individuals looking to increase…

1 day ago

Top Programming Trends You Need to Know in 2024

Programming continues to evolve at a rapid pace, with new trends and technologies emerging every…

1 day ago

Why startups need a digital marketing strategy?

Let’s be honest; a startup business hardly has sufficient amount to promote their services and…

2 days ago

How to Find the Best SEO Consultant in Toronto to Boost Your Rankings

Introduction In today's digital age, having a strong online presence is crucial for businesses in…

2 days ago