Web Analytics Made Easy -
StatCounter How to centre Div vertically - CodingForum

Announcement

Collapse
No announcement yet.

How to centre Div vertically

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to centre Div vertically

    Hey everyone,

    I need a way of having a div containing a vimeo embedder and a link directly in the middle of a screen, regardless of what size the screen is, so I need it to detect screen height and load half way down that if that makes sense.

    Is this possible?

    Thanks

  • #2
    No worries, found it:
    Code:
    <div style="position:absolute; left: 50%; top: 50%; margin: -197px 0 0 -300px; height: 394px; width: 600px; text-align:center;" />
    Thanks all

    Comment

    Working...
    X