Text that is aligned to the right

0

I have a text inside a div but it happens that when the line breaks it moves to the right

<div style="width: 300px;"><b> aqui va el texto que cuando llega el momento de saltar linea se va hacia la derecha</b></div>

How do I solve it?

    
asked by code2018 17.11.2018 в 00:51
source

1 answer

0

You could try moving just the box to the right. In this example you have

  position: relative;
  right: calc(300px - 100vw);

div {
  width: 300px;
  border: 1px solid;
  position: relative;
  right: calc(300px - 100vw);
}
<div><b> aqui va el texto que cuando llega el momento de saltar linea se va hacia la derecha</b></div>

Another possibility would be to use the old float:right :

div {
  width: 300px;
  border: 1px solid;
  float:right;
}
<div><b> aqui va el texto que cuando llega el momento de saltar linea se va hacia la derecha</b></div>

I hope it's what you need.

    
answered by 17.11.2018 в 10:31