Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Nov 2007
    Posts
    54
    Plugin Contributions
    0

    Default Please help with centering page- SilverFish template

    I have looked through my stylesheet extensively and am at a complete loss.

    my shops main page which can be found at
    www.hornsales.com

    appears centered in my browser but the main logo in the header was aligned left. I added text-align: center to #logo and that didn't work so I adjusted the padding of #logo and that worked.

    But certain pages will show up centered in my browser and others like this one :
    http://www.hornsales.com/catalog/ind...ex&cPath=65_81

    Show up aligned to the left of the browser and the logo image is still centered, I know it stays there because I used padding to position it.

    What I need to figure out is what is wrong in my stylesheet or what is overriding my stylesheet that is making some pages center in the browser and some pages align left. And Why I couldn't get
    #logo {text-align: center};
    to make my logo image center in the header so I can remove the padding and the logo image will appeared centered to the header box

    I have tried every instance in the style sheet of text-align: left or float: left , but changing any of them to text-align: center does not affect the anything.

    I feel there is an override in place that I didn't know I put in but I am clueless

    Please help

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Please help with centering page

    Try taking the postion:absolute; out of #logo, then move it around with padding and/or margin. Leave the text-align:center; in.

  3. #3
    Join Date
    Nov 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: Please help with centering page

    ok
    Taking out position: absolute helped somewhat. Now the logo image doesn't stay stuck n the middle of the browser screen when the page aligns left.

    But the logo image still won't center and changing the padding now doesn't move it and some pages are still aligning left while others center in the browser screen

  4. #4
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Please help with centering page

    I've never seen a stylesheet customized to that extent before! But looking through it to the extent I'm able to understand it, I think the problem has to lie in the section titled...

    /* SilverFish Customizations */

    ...since that's the only area of the stylesheet where the body and mainwrapper locations are defined.

    I'd start by laying out the element definitions in that section in separate lines so you can easily read the definitions being applied. Clarity of code helps with debugging.

    so when you change this...
    Code:
    body {margin: 0; text-align: center; font-family: verdana, arial, helvetica, sans-serif; font-size: 62.5%; color: #00000; margin: 10px 0px 50px 0px; color: #333; background: url(../images/bg_body.gif) repeat-x #6f9db8;}
    ...to this...
    Code:
    body {
    margin: 0; 
    text-align: center; 
    font-family: verdana, arial, helvetica, sans-serif; 
    font-size: 62.5%; 
    color: #00000; 
    margin: 10px 0px 50px 0px; 
    color: #333; 
    background: url(../images/bg_body.gif) repeat-x #6f9db8;}
    ... you can quickly see that you've defined margin and color twice each for the body tag. That won't be your problem, since the second definition takes precedence, but it indicates that it's going to be harder to figure out the problem than it needs to be.

    You may have closed up the code that way in an attempt to save stylesheet load time. That's no longer any kind of issue. Stylesheets load in a fraction of a second.

    Rob

  5. #5
    Join Date
    Nov 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: Please help with centering page

    This is the way the code came with the template. I have maybe made 2 or 3 adjustments. But I will make the layout changes so maybe I or someone can see the problem.

  6. #6
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Please help with centering page

    I noticed that template has a lot of tables in it, and the author seems to have removed the logoWrapper altogether.

    You might try installing a similar template and switching temporarliy to see if the header problem goes away.

  7. #7
    Join Date
    Nov 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: Please help with centering page

    I am not sure what a similar template would be.

    I did notice that if i remove

    margin: 10px 0px 50px 0px;
    from body then the pages that were aligning left suddenly align right even if I change it to
    margin: auto;

    So I am totally clueless here

  8. #8
    Join Date
    Nov 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: Please help with centering page

    Ok

    I have looked through many pages on my site. And it doesn;t appear to be any specific type of product or category that is aligning to the left. It is fairly random which pages line up center and which ones line up left. But it is always the same pages.

    Could it be something in my actual product and category descriptions that is making the alignment changes?

  9. #9
    Join Date
    Nov 2006
    Location
    Dartmouth, NS Canada
    Posts
    2,378
    Plugin Contributions
    0

    Default Re: Please help with centering page

    There certainly has to be something making a mess of things. Stylesheets don't behave randomly. If a style works on one page and nothing overrides it on a second page, it'll work on the second page too. But computers have a bad habit of doing exactly what we tell them to do instead of what we want them to do, so ...

    I would try running a working page through a validator, then running one of the odd pages through the same validator. Compare the two reports. Ignore the warnings; it's the errors that you'll need to look at closely.

    Do you have the Web Developer tools (or similar) in your browser?

    Rob

  10. #10
    Join Date
    Nov 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: Please help with centering page

    I have firebug installed in firefox

    what is this validator you are talking about?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. help with template please!
    By mike-b in forum Addon Templates
    Replies: 3
    Last Post: 22 May 2009, 09:17 PM
  2. Silverfish template code
    By Makoshark in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 24 Apr 2009, 06:43 PM
  3. Silverfish Template
    By sharq in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 16 Aug 2008, 09:24 PM
  4. HELP! Silverfish template
    By createafly in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 Aug 2008, 02:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg