How to put a div in center of browser both vertically and horizontally using CSS only?
Make sure it works on IE7 too.
If everything fails, we may use JavaScript, but a last choice.
How to put a div in center of browser both vertically and horizontally using CSS only?
Make sure it works on IE7 too.
If everything fails, we may use JavaScript, but a last choice.
HTML:
CSS:
For Older browsers, you need to add this line on top of HTML doc
You can also set your div with the following:
With that setting, the div will have a set width, and the margin and either side will automatically set depending on the with of the browser.
try this
Using this: