W3C home > Mailing lists > Public > www-style@w3.org > November 2001

How to vertical align an image?

From: Thomas Watson <w@tson.dk>
Date: Sun, 11 Nov 2001 17:22:16 +0100
To: <www-style@w3.org>
Message-ID: <000c01c16acd$0a7b7eb0$6b0110ac@ntvcom.dk>
I have a XHTML page (v1.1) where I have only one image. I want this
image to be displayed in the middle of the browser (both horisontal an
vertical aligned that is). 

This is my document type:
<?xml version="1.0" encoding="iso-8859-1"?>

And this is how I try to position my image:
<div style="height: 100%; text-align: center;">
	<img src="ddjalogo.gif" width="640" height="329" alt="" />

My style attribute on the div-tag only has a height and a text-align.
The text-align style centers the image horisontaly. But how to I center
the image verticaly?

I've been searching the web for quite some time now without even finding
documents about this problem. Am I missing something here? Or is there
no way at all to do this?

- Hope some of you can help me :)

Received on Sunday, 11 November 2001 11:20:13 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:59 UTC