Help - Search - Members - Calendar
Full Version: Vertical align images in basic html?
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
reggie
I have created a simple html page as the front page to my Web site. It contains two images which I want to appear centered: both vertically and horizontally, one directly on top of the other. I can get them horizontally centered easily enough using: <p style="text-align: center" >. But pretty much everything I look up about vertical alignment just really confuses me. I know very little about css or how it can be used along with my html, but I am happy to learn if necessary and since I am not looking to do much it shouldn't be extremely difficult. Here is the code I have so far (please let me know if the doctype is wrong, I just copied it).

QUOTE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>
<!-- ocugwu.com homepage
Author: Oguejiofor C. Ugwu
Date: 10/3/09
-->
<title>O.C. Ugwu + Home</title>
</head>

<body>
<p style="text-align: center">
<img src="http://www.ocugwu.com/ocugwu-home-graphic-top.jpg" alt="O.C. Ugwu: Stories in words + images"
/> <br />
<a href="http://www.ocugwu.com/blog"><img src="http://www.ocugwu.com/ocugwu-home-graphic-bottom.jpg" alt="E N T E R" style="border-style: none"
/>
</a>
</p>


</body>



</html>


Here is the page: ocugwu.com

If someone could help, I would be EXTREMELY grateful. Thanks so much.

- Reggie
reggie
Is there anyone here that can help me? PLEASE?
Darin McGrew
Well, for starters, what confuses you about these documents that explain vertical centering?
http://www.w3.org/Style/Examples/007/center.html
http://www.student.oulu.fi/~laurirai/www/css/middle/
http://hicksdesign.co.uk/journal/how-to-ve...tering-with-css
tebk77
Reggie,
in case you do decide to take a course in xhtml/css, I HIGHLY recommend this. I loved it. It's an online course that gives you 2 lessons a week and basically lasts a month or two. Also very reasonable prices. I found the instructor wonderful and very helpful. Also liked the forum where you could post your questions about the current or past lessons. I even asked gen'l questions not necessarily related to the course and the instructor was helpful. AND there's a list of recommended websites after each lesson. A wealth of information. Also recommend the XHTML/CSS Intermediate course after that.

http://www.ed2go.com/cgi-bin/ed2go/newcrsd...epartmentnum=WD

-tebk
reggie
I figured it out. Thanks for the links, Darin. I've learned a lot over the past week.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.