 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
Knighter
Joined: 07 Jul 2005 Posts: 2
|
Posted: Thu Jul 07, 2005 11:38 am A little help would be appreciated... |
|
|
|
Hello,
I am using styles to create a centered background image in a table for
a website. I managed to get the banner to align itself on the top
center, but when I try to put something directly under it, it warps
itself to the bottom of the page. I can still move it from
align=left/center/right, but valign doesn't work and I cannot get it
on the top. If you could please review my HTML and get back to me, I
would much appreciate any help. Thx
| Code: |
<html>
<head>
<style type="text/css">
body {
background-color: #000000;
margin-left : 0px;
margin-right : 0px;
margin-top : 0px;
margin-bottom : 0px;
background-image: url("images/background.jpg");
background-repeat: no-repeat;
background-position: top center;
}
</style>
head>
<table frame=void rules=none cellspacing=0 vspace=0 hspace=0
cellpadding=0 border=0 width=100% height=100%>
<tr>
<td align = "center" valign= "top" >
<img src="images/banner.jpg">
</td>
</tr>
<table align=center valign=top cellspacing=0 vspace=0 hspace=0
cellpadding=0 border=0 width=50 height=50>
<tr>
<td>
Testing
</td>
</tr>
</table>
</html> |
|
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8305 Location: Castle Pines North, CO USA
|
Posted: Fri Jul 08, 2005 4:16 am |
|
|
|
I think it all looks right, you just forgot to close the head properly and do the body:
| Code: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
body {
background-color: #000000;
margin-left : 0px;
margin-right : 0px;
margin-top : 0px;
margin-bottom : 0px;
background-image: url("images/bg.gif");
background-repeat: no-repeat;
background-position: top center;
}
</style>
</head>
<body>
<table frame=void rules=none cellspacing=0 vspace=0 hspace=0 cellpadding=0 border=0 width=100% height=100%>
<tr>
<td align = "center" valign= "top" >
<img src="images/bg1.gif">
</td>
</tr>
<table align=center valign=top cellspacing=0 vspace=0 hspace=0
cellpadding=0 border=0 width=50 height=50>
<tr>
<td>
Testing
</td>
</tr>
</table>
</body>
</html> |
|
|
Knighter
Joined: 07 Jul 2005 Posts: 2
|
Posted: Fri Jul 08, 2005 9:32 pm |
|
|
|
Okay, still no progress.
I inputted the code that you put in your reply, but it does the exact
same thing. To show an example of what it is doing, I've made a little
picture.
Thanks for your response and help, I am still new to tables and all. |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8305 Location: Castle Pines North, CO USA
|
Posted: Sat Jul 09, 2005 4:50 am |
|
|
|
Try something more like:
| Code: |
<table border="1" width="100%">
<tr>
<td> </td>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td> </td>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td> </td>
</tr>
</table> |
And code it / change as needed. I am heading out of town for a week but the guys and gals over at International Web Developers Network are around and will be able to help out as needed also. |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|