Jump to content

How to center text, images, etc.


blogsmith

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...