Search code examples
htmlcsstext-align

CSS replacement for text-align in percentage


Sticky speaking here's the question itself: Is there any property in CSS3 that alows to place some elements like <p> or any of <h$> like text-align but in percentage.

For instance HTML code:

<p id="first">Here's first P</p>
<p id="second">Here's second P</p>

and its style:

    <style>
        #first {
        margin-left: 50%;
        }
        #second {
            text-align: center;
        }
    </style>

It doesn't look the same in different width. Is there any property like background-position but for such elements as introduced above?


Solution

  • You can use text-ident to ident your text

    Link