Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

background images

Posted on 2004-10-13
4
191 Views
Last Modified: 2010-04-09
I have a bg image in a in a td but when I view it in the browswer it keeps duplicating the image like 4 more times down the page.  Even if I have content in the page I tried wrting text insert spacer gifs whats wrong heres the code. Any help will be much appreciated.
Phil
<html>
<head>
<title>Test</title>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="755" height="311" border="0" align="center">
  <tr>
    <td height="102" align="left" valign="top"><img src="headbar.gif" width="755" height="100"></td>
  </tr>
  <tr>
    <td width="77" height="25" align="left" valign="top" background="rednav.gif"><div align="center"><a href="www.">Home</a>
        | <a href="www.">About Us</a> | <a href="www.">Welcome</a> | <a href="www.">Online
        Store</a> | <a href="www.">Classes Schedule</a> | <a href="www.">Directions</a>
        | <a href="www.">Contact</a> | <a href="www.">Email</a> </div></td>
  </tr>
  <tr>
    <td height="47" align="left" valign="top"><p><font color="#000000">Spacer text here<br>Spacer text here<br>Spacer text here<br>Spacer text here<br>Spacer text here
        </font></p>
      </td>
  </tr>
  <tr>
    <td height="21" align="left" valign="top"><font color="#000000"><img src="spacer.gif" width="45" height="45">Spacer text here<br>Spacer text here</font></td>
  </tr>
  <tr>
    <td height="7" align="left" valign="bottom"><table width="774" height="76" border="0">
        <tr>
          <td width="764"><hr></td>
        </tr>
        <tr>
          <td><div align="center"><font color="#FF0000">Home | About Us | Welcome
              | Online Store | Class Schedule | Directions | Contact | Email </font></div></td>
        </tr>
        <tr>
          <td height="14"><div align="center"><font color="#000000" size="1">Copyright
              &copy; / 2004 - All rights reserved - </font></div></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
0
Comment
Question by:smphil
4 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 500 total points
ID: 12300535
Try to add a style="background-repeat:no-repeat;" to the cell where you do not want the repetition to occur.

Furthermore possibly go to www.w3schools.com/css because the type of html you use (<font>) is becoming somewhat oldfashioned these days.

Regards

-r-
0
 
LVL 2

Expert Comment

by:kylen1010
ID: 12303039
0
 
LVL 9

Expert Comment

by:jmanGJHS97
ID: 12310097
You can either use a style sheet for the table, or you can specify the style in the tag.  Here's an example of both ways:

//CSS WAY
.my_style
{
background-image: url(rednav.gif);
background-repeat: no-repeat;
background-position: center center;
}

Then in your tag, you do this:
<td width="77" height="25" align="left" valign="top" class="my_style">

//HTML WAY
<td width="77" height="25" align="left" valign="top" style="background: url('rednav.gif') no-repeat center center;">

I'd recomment the CSS way because it's a lot more flexible and powerful.

Jeff
0
 
LVL 9

Expert Comment

by:stefanaichholzer
ID: 12414396
Yes, that´ll do it:

 >> Try to add a style="background-repeat:no-repeat;" to the cell where you do not want the repetition to occur.

;)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question