code2018 Asked: 2020-11-17 15:51:49 +0800 CST 2020-11-17 15:51:49 +0800 CST 2020-11-17 15:51:49 +0800 CST Right-aligned text 772 I have a text inside a div but it happens that when it breaks the line 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? html 1 Answers Voted Best Answer enxaneta 2020-11-18T01:31:58+08:002020-11-18T01:31:58+08:00 You could try just moving 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 is what you need.
You could try just moving the box to the right. In this example you have
Another possibility would be to use the old
float:right
:I hope it is what you need.