Blast! What's wrong with this HTML?

etalns

Diamond Member
Dec 20, 2001
6,513
1
0
I just started doing some web designa gain recenetly, haven't touched the stuff in a while.

I can't figure out what's wrong with this code.

------ begin code ------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Qosis</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #000000;
}
-->
</style></head>

<body>
<table width="100%" height="100%" border="0">
<tr>
<td><div align="center"><img src="logo.jpg" width="178" height="78" align="absmiddle"></div></td>
</tr>
</table>
</body>
</html>

------- end code----

You can also view the page here

I'm trying to center the image in the middle of the page. I remember being able to just make a table that was 100% x 100% and then placing the image in the middle. It looks fine in dreamweaver, but when I save it is when I run into problems.
 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
Should have been posted in software/programming but, throw a border = 1 on your table and see where the table actually is.
 

bunker

Lifer
Apr 23, 2001
10,572
0
71
<td valign="middle"><center><img src="logo.jpg" width="178" height="78"></center></td>

should work
 

Rogue

Banned
Jan 28, 2000
5,774
0
0
Yep, border=1 is about the only way to check out your tables when you're hand coding.
 

etalns

Diamond Member
Dec 20, 2001
6,513
1
0
The table is limited to the top at the moment. It has 100% width, but not 100% height. Is there anythingat the code that would cause that?

And thank you to everyone for all the helpful replies :)
 

GtPrOjEcTX

Lifer
Jul 3, 2001
10,784
6
81
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" valign="middle"><img src="...........
 

Modeps

Lifer
Oct 24, 2000
17,254
44
91
Originally posted by: Qosis
The table is limited to the top at the moment. It has 100% width, but not 100% height. Is there anythingat the code that would cause that?

And thank you to everyone for all the helpful replies :)

I've found that 100% height really doesnt work too well, and there are very few uses to use it (other than what you're mentioning here). Try throwing just a pixel height on the table, or use a style

<table style="height:100%; width:100%"...
 

etalns

Diamond Member
Dec 20, 2001
6,513
1
0
Originally posted by: GtPrOjEcTX
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" valign="middle"><img src="...........

It's still sitting at the top with that code :(
 

jjones

Lifer
Oct 9, 2001
15,424
2
0
The html as written above works fine but if you compare that to the code on your page that you linked to, you will see that align="absmiddle" is missing from the img tag.
 

etalns

Diamond Member
Dec 20, 2001
6,513
1
0
Originally posted by: jjones
The html as written above works fine but if you compare that to the code on your page that you linked to, you will see that align="absmiddle" is missing from the img tag.

This is what I have at the moment, even with the align in the code it still isn't working :S

---- Begin Code -----

<html>
<head>
<title>Qosis</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #000000;
}
-->
</style></head>

<body>
<table>
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="1">
<tr>
<td align="center" valign="middle"><center><img src="logo.jpg" width="178" height="78" align="absmiddle"></center></td>
</tr>
</table>
</body>
</html>

----- End Code -----