I apologise in advance for this really silly question.

I'm just trying to centre an image at the top of a page, but I can't for
the life of me do it.  I must be going mad.

All I have in my html file so far is this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
    <head>
        <title>Spanish Intensives - Home</title>
        <meta http-equiv="content-type" content="text/html;
charset=utf-8" />
    </head>
    <body>
        <img id="logo" src="images/Logo-SI-BIG4b.jpg" alt="Spanish
Intensives logo" title="Spanish Intensives" />
    </body>
</html>


In my CSS file, I've tried:

#logo {
    margin-left:20%;
    margin-right:20%;
}

I've tried various percentages but none work.

I've also tried:

#logo {
    width:60%;
    margin:auto;
}

(at various widths - using ems, percentages and pixels)

I've also tried putting the image in a div and tried centering the div,
but with no more luck than with the image itself.

Whatever I do, the img sticks stubbornly to the left of the viewport.

I'd be very grateful if someone could put me out of my misery.

Thanks


Peter

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to