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 to align text to the right and turn to the left on same time?

I would like to align a text to the right completely but at the same time that the text is to the left. For example:

enter image description here

.u-right-horizontal {
  text-align: right;
  text-align-last: left;
  text-justify: left;
}
<div>HTML here please!</div>

But I have only been able to align them to the right And what I have is:

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

enter image description here

Here my css property:

.u-right-horizontal {
  text-align: right;
  text-align-last: left;
  text-justify: left;
}

I would like to have the text as in the first attached photo. But I’ve only gotten as far as the second attached photo with the css property.

If you could help me I would be grateful

>Solution :

You have to push only the wrapped container div to the right. For that you can use for example margin-left: auto;.

working example

.w {
  background: gray;
  
}
.sum {
  background: green;
  width: 30%;
  margin-left: auto; 
  margin-right: 0;
}
<div class="w">
  <div class="sum">
    <p>lorem: 123</p>
    <p>lorem: 456</p>
    <p>lorem: 678</p>
    <p>sum</p>
  </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