Wondering if there is a CSS3 property that allows for the positioning of elements like <p>
or any <h$>
with percentages instead of pixels, similar to the way text-align
works.
For example, consider this HTML code:
<p id="first">Here's first P</p>
<p id="second">Here's second P</p>
and its corresponding styles:
<style>
#first {
margin-left: 50%;
}
#second {
text-align: center;
}
</style>
The issue arises when viewing this layout on different screen widths. Is there a property similar to background-position
that can be used to position these elements as described above?