How to align the <p> tag?
I have a couple of <p> tags that I want to right justify. Does anyone know how to do this?
CSS
p { text-align: right; } INLINE:
<p style="text-align: right">Some Text</p> JQuery
$('p').css('text-align', 'right'); JavaScript:
var aElements = document.getElementsByTagName('p'); for (var i = 0; i < aElements.length; i++) { aElements[i].style.textAlign = 'right'; } It depends. Do you want the whole paragraph to match the right side of any container? Or do you want the paragraph text to fit the right edge of the paragraph?
If this is the first, look in float: right; CSS directive. Last one, text-align: right;
You can try to make the correct field equal to zero