blogsmith Posted January 5, 2007 Share Posted January 5, 2007 I tried looking for the answer by searching for "center text" and it didn't answer my question. I want to center some text/photos etc. in a blog post, but don't want to do it in the external CSS but with an "inline" CSS (inside the post.I tried <span style="text-align: center;">These text us Centered</span>but it didn't work. How do I do it?TIA Link to comment Share on other sites More sharing options...
jlhaslip Posted January 5, 2007 Share Posted January 5, 2007 Span is an in-line element which (I think) is not able to be centred. Try placing the text into a block-level tag like <p> or <div>, then center it using {margin:auto; text-align: center;}.If you need any more help, post back here. Link to comment Share on other sites More sharing options...
Anders Moen Posted January 6, 2007 Share Posted January 6, 2007 Of course <span style="text-align: center;">text</span> won't work, because you don't have a width of the span tag.Instead you should use;<div style="width: 300px; text-align: center;"><span>all your content</span></div>Just change the width to what you want.And by the way, I've noticed the <span> element gets ######ed up in either IE, FF, Opera or something else. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now