Centered text... not centering?

Discussion in 'Web Design and Development' started by Mal, Feb 2, 2010.

  1. Mal
    macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #1
    I'm having trouble with one of the sites I run, one page particularly. I've got titles on divs (which are float left and right to place them next to each other) which are supposed to be center aligned, but they are falling left aligned. I can't figure out why, and I'm probably making the whole page far more difficult than necessary, so if anyone has any suggestions, please pass them on. I know this is a commercial website, but my main job isn't really doing this, and I'm essentially still an amateur.

    The page is http://www.connectingpt.com/sales.php, and the css is at http://www.connectingpt.com/default.css.

    jW
     
  2. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Remove the width and position property from .label selector. Do you have Firebug? You can kind of see what's going on with the CSS using it.
     
  3. macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #3
    Not sure I get which part you mean, do you mean the nav menus?
     
  4. macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #4
    Wow, you sussed that quickly. I was still trying to work out what the question was. :rolleyes:
     
  5. Mal
    thread starter macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #5
    Angelwatt, thanks again, but your solution is only partly accurate. In trying to fix the issue you mentioned, I discovered a more important reason I was having trouble. .label is defined twice in my css file. Heh.

    Unfortunately, it didn't work. I did, however, get it fixed by increasing the width to the proper size. I had it too small.

    jW

    BTW, does anyone have any suggestions for a better way to manage this type of layout? It's essentially a grid. I didn't really want to have a table layout used for that, though, even though I know I could make it work.
     
  6. macrumors 6502a

    Denarius

    Joined:
    Feb 5, 2008
    Location:
    Gironde, France
    #6
    Personally I like it. I don't really know of anyone using tables to make their page layouts any more since they're so inflexible when it comes to making changes. The only thing I'd consider is that, because you have quite big differences in the page layout for each page, but common things as well, I'd think about separating CSS into

    default.css (common stuff applicable to all pages)
    sales.css (stuff applicable only to sales)
    home.css (stuff applicable only to home)
    and so on.

    Just slightly easier to manage in terms of locating the relevant styles IMO, but that's just me.
     
  7. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #7
    That was partly why I suggested Firebug so you could see it was narrower, depending on how you wanted to fix it. With CSS, there's definitely more than one way to skin a cat.
    Take a look at YUI Grids CSS. Might get after what you're wanting.
     
  8. Mal
    thread starter macrumors 603

    Mal

    Joined:
    Jan 6, 2002
    Location:
    Orlando
    #8
    Yeah, I just hate Firefox. I'll have to start using that though.

    Hmm, sounds interesting. Will look into it.

    jW
     
  9. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #9
    There is a Firebug lite for Safari, Opera, IE, and Safari's developer tools is comparable too so I recommend it as well if Safari is your preferred browser.
     

Share This Page