challenger Posted September 25, 2006 Share Posted September 25, 2006 Hi,I was wondering if anybody could help me with this question. I searched alot for alignment in XHTML and CSS but didn't find what I need.This is what I want to do with CSS:http://img124.imageshack.us/img124/6856/blockmw2.jpgThe block has a fixed width and height and just needs to be centered in the page. Can anybody tell me how to do this? Most examples are just about 100% height tables. (Or don't work in IE AND FireFox) Link to comment Share on other sites More sharing options...
S@m Posted September 25, 2006 Share Posted September 25, 2006 http://www.mezzoblue.com/tests/centered-css/Hope this helps! Link to comment Share on other sites More sharing options...
challenger Posted September 27, 2006 Author Share Posted September 27, 2006 Anybody else with example code? This example above is mainly about horizontally centering Link to comment Share on other sites More sharing options...
jesh Posted September 27, 2006 Share Posted September 27, 2006 If the height of the yellow box is fixed, you might try CSS positioning: <style type="text/css">#outerdiv{ height: 600px; position: relative; }#innerdiv{ height: 300px; position: absolute; top: 150px; margin: auto;}</style> Link to comment Share on other sites More sharing options...
challenger Posted September 28, 2006 Author Share Posted September 28, 2006 No it's not fixed.. Only width and height are. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now