desibhupi Posted February 24, 2007 Share Posted February 24, 2007 I have made a javascript that opens a picture in Div (absolute positions mentioned in css) I want to show this image in this specific div but exactly in the center (horizontally and vertically) of the bowser screen. Can anybody help in this regards, Thanx in advance Bhupinder Quote Link to comment Share on other sites More sharing options...
desibhupi Posted February 26, 2007 Author Share Posted February 26, 2007 still no suggessions ??? plz help Quote Link to comment Share on other sites More sharing options...
kucing Posted February 26, 2007 Share Posted February 26, 2007 HI.. you may want to look at lightbox.. http://fortysomething.ca/mt/etc/archives/005400.php Which do exactly what you just mentioned. K Quote Link to comment Share on other sites More sharing options...
Stickybomb Posted March 5, 2007 Share Posted March 5, 2007 no do not use lightbox this is easy to accomplish with css just set your margin to auto in all cases using css example <div style="margin:auto auto;"></div> this should accomplish what you are looking for. Also kind of off subject but lightbox is a horibble way to accomplish what it does, since it uses prototypes that contain way to much code then you need. Anyways hope this helped Quote Link to comment Share on other sites More sharing options...
obsidian Posted March 5, 2007 Share Posted March 5, 2007 no do not use lightbox this is easy to accomplish with css just set your margin to auto in all cases using css example <div style="margin:auto auto;"></div> this should accomplish what you are looking for. Also kind of off subject but lightbox is a horibble way to accomplish what it does, since it uses prototypes that contain way to much code then you need. Anyways hope this helped This in theory works; however, since top and bottom auto margins do not display properly in any modern browsers yet, you'll have to come up with something different. Read up on the W3 Vertical Centering page for the methods of centering things that are available. Hopefully, with CSS3, there will be additional options. 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.