Jump to content

center align


user4fun
 Share

Recommended Posts

Why in the world would this not cause it to be centered.

.BannerFloat{background:url("images/site_banner.png") no-repeat; width:960; height:213px; margin:auto;}

I also tried this

.BannerFloat{background:url("images/site_banner.png") no-repeat; width:960; height:213px; margin-left: auto; margin-right: auto;}

Iam using IE8 an the foctype is declared[code<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/code]

Edited by user4fun
Link to comment
Share on other sites

Nothing happenedI tried this in ont of the Tryit Editors on this site

.BannerFloat{margin:auto;width:960px;height:213px; background:url("http://www.mysite.com/vcso/images/site_banner.png") no-repeat; }

and it worked.When I try it on my site, it does not?

Edited by user4fun
Link to comment
Share on other sites

cleared the cache?.BannerFloat{background:url("images/site_banner.png") no-repeat; width:960px; height:213px; margin:0 auto;}<div class="BannerFloat"></div>as long as this is not within a parent element other than body it should work.if it is in a parent element other than body, this element should be 100% wide, or at least have same width, and also centred.

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
 Share

×
×
  • Create New...