PDA

View Full Version : Centered text... not centering?




Mal
Feb 2, 2010, 08:45 PM
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



angelwatt
Feb 2, 2010, 08:55 PM
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.

Denarius
Feb 2, 2010, 08:55 PM
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

Not sure I get which part you mean, do you mean the nav menus?

Denarius
Feb 2, 2010, 09:01 PM
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.

Wow, you sussed that quickly. I was still trying to work out what the question was. :rolleyes:

Mal
Feb 2, 2010, 10:18 PM
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.

Denarius
Feb 3, 2010, 03:54 AM
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.

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.

angelwatt
Feb 3, 2010, 05:59 AM
I did, however, get it fixed by increasing the width to the proper size. I had it too small.
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.
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.

Take a look at YUI Grids CSS (http://developer.yahoo.com/yui/grids/). Might get after what you're wanting.

Mal
Feb 3, 2010, 08:40 AM
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.

Yeah, I just hate Firefox. I'll have to start using that though.

Take a look at YUI Grids CSS (http://developer.yahoo.com/yui/grids/). Might get after what you're wanting.

Hmm, sounds interesting. Will look into it.

jW

angelwatt
Feb 3, 2010, 10:42 AM
Yeah, I just hate Firefox. I'll have to start using that though.

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.