Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: derekj54 on March 16, 2010, 02:55:58 AM

Title: Trying to center logo in style.css
Post by: derekj54 on March 16, 2010, 02:55:58 AM
#logo {
   position: absolute;
   top: 35px;
   left: 300px;
   display: block;
   width: 342px;
   height: 250px;
   cursor: pointer;
   background: url(./images/img/logo.png) no-repeat;

tried a lot of things but not sure what to change to center it, i got it centered on my resolution but its definately not good enough
Title: Re: Trying to center logo in style.css
Post by: Oldiesmann on March 16, 2010, 12:13:22 PM
Get rid of the position, top and left parts, and add text-align: center; to it. That should center it.
Title: Re: Trying to center logo in style.css
Post by: derekj54 on March 16, 2010, 11:15:59 PM
didnt work
Title: Re: Trying to center logo in style.css
Post by: derekj54 on March 17, 2010, 12:56:48 AM
the site im workin on is http://destinyeq2.com/
given that the logo sucks right now just a placeholder for a good one but right now i got it set at left at a % so it doesnt look terrible when you change the resolution but its still bad, i tried putting center in there like you said, i tried on a few different line and i looked up some .css pages for other commands but nothing has worked
Title: Re: Trying to center logo in style.css
Post by: smp420 on March 17, 2010, 01:13:32 AM
use
margin-left:auto;
margin-right:auto;
Title: Re: Trying to center logo in style.css
Post by: derekj54 on March 17, 2010, 02:08:32 AM
that works, thank you lots
Title: Re: Trying to center logo in style.css
Post by: smp420 on March 17, 2010, 02:16:36 AM
No problem