I am trying to center a paragraph tag with some text in it within a div, but I can\'t seem to center it using margin: 0 auto without having to specify a fixed width for the
if the div has set width all you need is
.myDiv { text-align:center; }
Also listen to garry's comment. under no circumstances use inline css.
Also another dirty fix for this in case you have other stuff in the div to centre:
you can always:
$('.youParagraph or .otherContent').wrap('');
Obviously do not practice this if you work within a large team and separation of concerns is an issue.
I hope this helped.