3 Replies - 1181 Views - Last Post: 16 November 2006 - 09:45 PM

#1 °•Guru•°  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 17-October 06

Vertically aligning in css

Post icon  Posted 14 November 2006 - 10:44 PM

hey all i am trying to center my webpage through css vertically and horizontally...i can get it to do it horizontally but how would you do it to centre vertically??

Cheers Peeps :)
Is This A Good Question/Topic? 0
  • +

Replies To: Vertically aligning in css

#2 Tuzoid  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 120
  • Joined: 20-August 06

Re: Vertically aligning in css

Posted 15 November 2006 - 07:19 AM

you could try margin-top:VALUE, replacing VALUE with a percent or pixels...

Hope this helped
Was This Post Helpful? 0
  • +
  • -

#3 beef  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 141
  • Joined: 02-November 06

Re: Vertically aligning in css

Posted 15 November 2006 - 08:28 AM

There's a vertical-align property in css, I think its middle to center it but you might double check. The msdn library (go to msdn.microsoft.com and click on library) has a really good html/css reference under web development.
Was This Post Helpful? 0
  • +
  • -

#4 Arbitrator  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 51
  • View blog
  • Posts: 530
  • Joined: 26-January 05

Re: Vertically aligning in css

Posted 16 November 2006 - 09:45 PM

View Postbeef, on 15 Nov, 2006 - 08:28 AM, said:

There's a vertical-align property in css, I think its middle to center it but you might double check.
The vertical-align property is for controlling the vertical position of text inside its line box, not vertically aligning general content. That’s why you can’t do something like vertically center the content of a div element using this property. An exception to this is table cells (or in boxes with display: table-cell) where it mimics the effect of the old valign attribute and vertically centers the content of the cell, as most people would expect. The vertical-align property combined with display: table-cell would actually work fine here except for one problem: the dominant Internet Explorer up to version 7 doesn’t support display: table-cell.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1