Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indent text left and right

Tags:

html

css

I am using the p tag to align text left and right on the same line using:

.left
{
    float: left;
    text-indent: 5px;
    margin-top: 0px;
}

.right
{
    float: right;
    text-indent: 5px;
    margin-top: 0px;
}

<div id="content">

    <p class="left">Left Text </p>

    <p class="right">Right Text </p>

</div>

The left text will indent by 5 pixels, the right text will not. I have tried -5px and just 5px, any ideas how I could do this?

Thanks

like image 976
Elliott Avatar asked Dec 22 '25 01:12

Elliott


1 Answers

You can use margin-left and margin-right instead. Or padding-left and padding-right depending on your desired output/requirement.

like image 104
Sarfraz Avatar answered Dec 24 '25 14:12

Sarfraz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!