HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
A little help would be appreciated...
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table
View previous topic :: View next topic  
Author Message
Knighter



Joined: 07 Jul 2005
Posts: 2

PostPosted: Thu Jul 07, 2005 11:38 am     A little help would be appreciated... Reply with quote

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 Wink


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: 8257
Location: Castle Rock CO USA

PostPosted: Fri Jul 08, 2005 4:16 am     Reply with quote



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

PostPosted: Fri Jul 08, 2005 9:32 pm     Reply with quote

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: 8257
Location: Castle Rock CO USA

PostPosted: Sat Jul 09, 2005 4:50 am     Reply with quote

Try something more like:
Code:
<table border="1" width="100%">
   <tr>
      <td>&nbsp;</td>
   </tr>
</table>

<table border="1" width="100%">
   <tr>
      <td>&nbsp;</td>
   </tr>
</table>

<table border="1" width="100%">
   <tr>
      <td>&nbsp;</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.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial