954,132 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Vertical Align Image

This is doing my nut in as I'm sure it must be really simple. All I want to do is display an image in the center of my webpage vertically and horizontally:

http://www.blackdrop.org/

What do I need to do and thanks for any help!

MrScruff
Junior Poster in Training
89 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

Im not sure what your asking. How are you going to display the same image two different ways. Or do you mean you want to position it in the center of the page.
you most likely want to use css for this and absolute position the image.

img.center {
position:absolute;
top:25%; /*change to fit*/
left:45%;/*change for page*/
}
 <!--Then your html should be-->
<img class="center" src="MFTP.jpg" alt="" />


I would recommend not using tables for your webpage as well.

mikeandike22
Nearly a Posting Virtuoso
1,496 posts since May 2004
Reputation Points: 33
Solved Threads: 19
 

That won't center it in the browser window, though...will it?

I mean, it will work for a specific resolution on a specific browser, but not across all platforms.

FC Jamison
Posting Pro in Training
Team Colleague
446 posts since Jun 2004
Reputation Points: 92
Solved Threads: 21
 

yea I know but the more content you add the longer the page is gonna get anyways. So it can never truly be center w/o javascript im assuming or possibly you could use the vertical-align property in css and set it to middle.

mikeandike22
Nearly a Posting Virtuoso
1,496 posts since May 2004
Reputation Points: 33
Solved Threads: 19
 
I would recommend not using tables for your webpage as well.



i hate to dig up old threads but i was wondering why you dont recommend tables?

Killer_Typo
Master Poster
781 posts since Apr 2004
Reputation Points: 152
Solved Threads: 39
 

Let's not start that debate again. It's been covered here, there, and everywhere already.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 
Let's not start that debate again. It's been covered here, there, and everywhere already.



:-| i wasnt looking for a debate, i was just looking for a different way to try and design my pages. im always open to different methods, especially if i see an increase in usability and decrease in overall load times and all that jazz.

Killer_Typo
Master Poster
781 posts since Apr 2004
Reputation Points: 152
Solved Threads: 39
 

Cool. The main debate is "tables" vs. XHTML with divs and CSS. I just didn't want that hashed out again, as it gets political.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You