CSS Help! - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: General (/forumdisplay.php?fid=11) +---- Forum: General Chit Chat (/forumdisplay.php?fid=14) +----- Thread: CSS Help! (/showthread.php?tid=75203) CSS Help! by Eddie on 06-09-2007 at 09:50 AM
Ok then, after talking with Nathan a bit i decided to move into a DIV / CSS Based layout instead of tables everywhere, and its been going pretty well and the code looks better to me but i'm not sure... code:The website can be found here, any other comments would be appreciated, but be aware its only a temporary page RE: CSS Help! by ayjay on 06-09-2007 at 10:12 AM
add margin-left: -200px; (half of the div width) and left: 50%; to the div properties. That way, you're making it 50% from the left of the page to the middle of the div. code: RE: CSS Help! by Eddie on 06-09-2007 at 11:34 AM
Sorry you misunderstood i think, thats the css code of the box, i want that box centred on the page, not content inside of that centred directly, i also want it completely centered on the page from the top and the side. RE: CSS Help! by Nathan on 06-09-2007 at 12:01 PM just get rid of the height atribute. RE: CSS Help! by Supersonicdarky on 06-09-2007 at 12:25 PM
cant you do margin: auto; for ff and text-align: center; in parent for ie? RE: CSS Help! by Nathan on 06-09-2007 at 12:30 PM no it doesnt, i asked him to try that too. And its not margin: auto, its margin: 0 auto; RE: CSS Help! by hmaster on 06-09-2007 at 12:32 PM
Try this: http://exanimo.com/examples/css/vertical-centerin...-floated-shim.html RE: CSS Help! by Lou on 06-09-2007 at 12:33 PM
for the vertical alignment: code: RE: CSS Help! by Nathan on 06-09-2007 at 12:39 PM
Here's an example I just coded up: You should be able to learn from it RE: CSS Help! by ayjay on 06-09-2007 at 12:45 PM
quote:That's exactly what it does. To do it centered from the top, just do the same but with margin-top and top:50%. EDIT: oh, just seen it's not a specified height, nvm quote:Doesn't work in IE. RE: CSS Help! by Eddie on 06-09-2007 at 12:49 PM
quote:Cool, but box to big and i dont understand how you did that because you just told me to delete the height attribute! quote:i could of done a search but i decided to ask here because its easier and i get multiple opinions. quote:will try that thanks. i will edit once tried these. thanks. RE: CSS Help! by albert on 06-09-2007 at 02:56 PM
The easy way to do this? code: Saves you from a bunch of problems to center-it horizontally. As for the vertical, depending on how big your container is (e.g. 40%), you would simply have to do : (100% - 40%) / 2, and then use the result ( 30% here) and use it as top in your position propriety. code: RE: CSS Help! by ayjay on 06-09-2007 at 03:17 PM
quote: That's fine if you have a fixed size, which he doesn't RE: CSS Help! by Lou on 06-09-2007 at 04:10 PM
quote:First of all, that's incorrect. Also, it's not xhtml valid. code: RE: CSS Help! by Eddie on 06-09-2007 at 04:23 PM
quote:Cheers, will try that tomorrow RE: CSS Help! by Eddie on 06-11-2007 at 12:47 PM i had a fiddle with these different methods, none of which worked |