Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can we align text horizontally using css?

We have some text in vertically align in html output:

Test 1 
Test 2 
Test 3 
Test 4 

Now we would like these text horizontally align using css :

Test 1 Test 2 Test 3 Test 4

Is there any way to do this using css ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Updated :

<div class="horizontal">
<div>Test 1</div>
<div>Test 2</div>
<div>Test 3</div>
<div>Test 4</div>
</div>

>Solution :

you can also use display: inline-block to all div inside container

.horizontal div {
  display: inline-block;
}
<div class="horizontal">
<div>Test 1</div>
<div>Test 2</div>
<div>Test 3</div>
<div>Test 4</div>
</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading