Jump to content

Place div in the center screen


GoldSoft

Recommended Posts

  • 2 weeks later...

Hi dsonesuk, it is center in horizontally and about vertically means height of ur webpage .. my code is for center regardless of height .. if u know the height u can adjust as u wish ... for each query there is a separate code... so DIV center that too horizontally until know the height

Link to comment
Share on other sites

Title of topic "Place div in the centre screen", NOT text, the div being a block element stretches to the width available to it, only the text is centred when text-align: center; is used and is not vertically aligned in centre/middle because the height of div is determined by content, so it will always appear at the top of browser window screen instead of vertically centre/middle, which is what the poster wants for DIV element to automatically without the need to specify height place itself in middle of screen and NOT TEXT!

Link to comment
Share on other sites

one more thing until define a width of a DIV the text inside the DIV is center if u want DIV center try this also<div align="center" style="background-color:#FF0000;">Put your code here..</div>

Again would ONLY CENTRE TEXT within any block element such as div, and will centre inline element such as anchor, but still not a DIV.
Link to comment
Share on other sites

1) it does NOT! work anyway.

2) NO! the aim is to use current valid html, css to current standards.

3) http://w3schools.invisionzone.com/index.php?showtopic=48809 link which i have already provided, and pointed out to you before, has the solution or to be precise 3 solutions, all using valid html/css current standards. css 2 and css3.

Edited by dsonesuk
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...