Micah C Posted March 8, 2009 Share Posted March 8, 2009 Hello Everyone, I am programming a website for a client and I have run into a problem. I am trying to center a CSS image box. (Code listed below) Can anyone help me with this? Any Suggestions and ideas are welcome. Thanks for the help. Micah C Original Code found at: http://sonspring.com/journal/hoverbox-image-gallery The code is not currently centering on the clients website. Quote Link to comment Share on other sites More sharing options...
digip Posted March 8, 2009 Share Posted March 8, 2009 Hello Everyone, I am programming a website for a client and I have run into a problem. I am trying to center a CSS image box. (Code listed below) Can anyone help me with this? Any Suggestions and ideas are welcome. Thanks for the help. Micah C Original Code found at: http://sonspring.com/journal/hoverbox-image-gallery The code is not currently centering on the clients website. Looks centered to me?? Quote Link to comment Share on other sites More sharing options...
dennis123123 Posted March 8, 2009 Share Posted March 8, 2009 me too Quote Link to comment Share on other sites More sharing options...
wire Posted March 9, 2009 Share Posted March 9, 2009 Yes obviously the example code works fine. Quick and dirty solution: try loading the example CSS code last, either by putting it at the end of your single CSS file on your client's site or by putting it in the last CSS file to load. That will make sure whatever code that is breaking the centering is overridden by the properly-working example. You might also want to post this problem at webmasterworld, where I take all my broken CSS. Their forum rules that disallow linking will help you get to the bottom of the problem by untangling your spaghetti code into a simple example. Quote Link to comment Share on other sites More sharing options...
DingleBerries Posted March 9, 2009 Share Posted March 9, 2009 Or just upload you css and html for us to look at? Quote Link to comment Share on other sites More sharing options...
Bit Hunter Posted March 9, 2009 Share Posted March 9, 2009 This is the trick i usually apply when i need to have centered. left: 50%; margin-left: <half the width>px; Quote Link to comment Share on other sites More sharing options...
xdmag Posted March 10, 2009 Share Posted March 10, 2009 I'm assuming you mean horizontal centering... Try - .class { margin: 0 auto; } (You can of course substitute the 0 for any other value.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.