PDA

View Full Version : Simple bit of help


fashew
01-25-2004, 10:36 AM
Ok, so the html coding goes like this:



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>
Welcome to Portsville
</title>
</head>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<a href="http://www.portsville.com/community">
<img src="images/welcome.jpg"
</body>
</html>



The bit in red relates to a particular image. What I want to know is how to make this image ALWAYS centered horizontally and vertically, no matter how big the browser window (at the moment it's always top left).

Thank you for your help!

metawu
01-25-2004, 12:30 PM
I think this is in the wrong section but

<div align="center"> <img src="images/welcome.jpg" align="absmiddle" > </div>

That should do it.

metawu
01-25-2004, 12:35 PM
Oh yea and it should be in a table with
<table width="100%" height="100%"> pic in here </table>

fashew
01-25-2004, 12:40 PM
Wrong section? Graphics and Design? Well, if it is, I'm very sorry...

Anyway, it's now aligned horizontally to the centre, but vertically is still stuck at the top...

metawu
01-25-2004, 04:40 PM
Well I thought there was a coding section or something like that.

did you put it in a table? Try something like this then...

<table width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="center" align="center">
<img src="">
</td>
</tr>
</table>

The valign should align it vertically.

fashew
01-26-2004, 03:03 PM
Coding... Hmm... You could be right there... ;)

Anyway, your help was much apreciated and I now have it working, thanks to you! Only one thing: I have the image as a link which works perfectly, but the blank space to the left of the image is also clickable as a link? Weird...

metawu
01-26-2004, 07:19 PM
Wierd, that I can't help you with. :P

I'd have to see the code to know what is going on. But you were missing a </a> after the
<a href="http://www.portsville.com/community">
<img src="images/welcome.jpg">

fashew
01-27-2004, 02:29 PM
Yeah, I added that earlier, but it still didn't solve it... Never mind though I'm happy so far, I'll just worry about that later on.

Thanks for all your help!

metawu
01-27-2004, 02:45 PM
Meh, no problem. I don't know much html myself, sort've just picking it up by looking at other ppls pages.

I'm sure its not that hard, it's just I don't have the motivation to learn all that code. :P Someday, maybe someday...

Oh and making it work in nutscrape- i mean netscape is a whole new battle. I just don't get it. Something with tables I think.

johnb
01-28-2004, 11:44 AM
This is just a hunch having not seen the code, but I suspect you put the anchor tags around the td tags, making the whole cell clickable.