jskogheim Posted September 6, 2008 Share Posted September 6, 2008 I'm trying to center a div with an unknown width. I know using auto margins requires a width, is there any way around this? Actually auto margins doesn't even work when I specify a width. I'm thinking that is because the div I'm trying to center is in a div that is already using auto margins. Any suggestions???Heres the page I'm working on: www.jakobskogheim.com/portfolios.htmlI'm trying to center the three portfolio sections which are contained in a div with the id 'group'. The css file: www.jakobskogheim.com/css/style.cssThanks Link to comment Share on other sites More sharing options...
jlhaslip Posted September 6, 2008 Share Posted September 6, 2008 I get a bunch of javascript on that page. Link to comment Share on other sites More sharing options...
Jesdisciple Posted September 6, 2008 Share Posted September 6, 2008 Do you have Firebug enabled, jlhaslip? I already made that mistake. Link to comment Share on other sites More sharing options...
jskogheim Posted September 6, 2008 Author Share Posted September 6, 2008 Hopefully not a lot of people viewing my site use firebug Or any type of error/bug finder. You have to turn the whole thing off in FF to make it work. Link to comment Share on other sites More sharing options...
jlhaslip Posted September 6, 2008 Share Posted September 6, 2008 disabling Firebug worked...now to the problem:removing the table-cell rule centres the images, but it also moves them to the top of the containing div.will that work? are you planning on more than these three images? Link to comment Share on other sites More sharing options...
jskogheim Posted September 6, 2008 Author Share Posted September 6, 2008 I'm planning on having more than three. And I want them to be vertically centered, thats why the table cell rule is there. Maybe I need to add one more div and try to horizontally center that. But thats a lot of divs and seems unnecessary. Link to comment Share on other sites More sharing options...
jlhaslip Posted September 6, 2008 Share Posted September 6, 2008 have a look at the Hoverbox layouthttp://www.jlhaslip.com/hoverbox/ Link to comment Share on other sites More sharing options...
jskogheim Posted September 6, 2008 Author Share Posted September 6, 2008 It looks like thats just using auto margins to position the body in the center, and then padding to control each list item. I'm already using auto margins on the main div, and you need to specify a width to use them, which I'd like to not do. And even if I do specify a width, it still doesn't work. Maybe I'm not seeing whats going on in that example? Link to comment Share on other sites More sharing options...
jskogheim Posted September 7, 2008 Author Share Posted September 7, 2008 Now I can't even get it to center horizontally when I remove the vertical centering rules. What am I doing wrong??? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.