According to the experts at W3Schools
The
align
attribute is no longer supported in HTML5. Using CSS is the recommended approach.
I am puzzled by how I can align two paragraphs on the same line.
I am open to using flexbox for this task, but I want to avoid adding unnecessary dummy elements or complicating it with rows and columns.
This is my current attempt, where the text-align
property doesn't seem to have an effect:
p {
display: inline-block;
}
.center {
text-align: center;
}
.right {
text-align: right;
}
<div class="container">
<p class="center">Center</p>
<p class="right">Right</p>
</div>