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!

Recommended Answers

All 7 Replies

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.

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.

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.

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?

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

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.