I have a <p>
tag within a <p>
tag. I am using the second <p>
tag to do formatting of texts in between the line. I want to print those in the same line and align it to the center of the page. I tried few css tricks like text-align:center;
display:inline-block;
even the simple align:center
but since I have other <p>
tags within, it breaks into next line.
Can anyone suggest me a feasible way to do this?
<p style="display:inline-block; text-align:center; position: relative">
Followers:
<p style="font-size:20px; display:inline-block; text-align:center;">100</p>
Following:
<p style="font-size:20px; display:inline-block; text-align:center;">200</p>
Tweets:
<p style="font-size:20px; display:inline-block; text-align:center;">2113</p>
</p>
` elements. The HTML parsing rules mean that a `
` is inserted before the `` implicitly. Try writing meaningful HTML before worry about styling it.
– Quentin Apr 26 '22 at 09:26