• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Validation fails on attribute - background

0
GUEEN
Asked:
GUEEN
  • 7
  • 5
2 Solutions
 
kevp75Commented:
you could use an inline style here:
<td style="background:url("picts/bluebar.gif");" colspan="3">
just make sure to set the repeat if you need it

instead of:<td background="picts/bluebar.gif" colspan="3">
0
 
kevp75Commented:
or...if you are using the same background for every single td element, best bet would be to do it in your CSS style sheet

td  {
     background:url("picts/bluebar.gif");
    }

but again, you will need to set your repeating if any
0
 
GUEENAuthor Commented:
I keep losing my bluebar with that code! I only have the blue bars at the top and bottom of the page. (only for two TD elements>

<tr><td background="picts/bluebar.gif" colspan="3">
<IMG SRC="picts/spacer.gif" alt="spacer" HEIGHT="17" WIDTH="15" border="0"><BR>
</td></tr>
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
kevp75Commented:
try this out for now:
<td style="background:url("picts/bluebar.gif") repeat-x;" colspan="3">

I will setup a page with an image like how you have it, and test.  I'm pretty sure repeat-x is for a horizontal repeat, and repeat-y is for verticle
0
 
GUEENAuthor Commented:
as soon as I put that code in - my bar disappears! I am serious.
0
 
kevp75Commented:
can you tell me what you see on this page:http://www.portalfanatic.com/test8.asp
0
 
GUEENAuthor Commented:
2 black bars (top)
0
 
kevp75Commented:
faded black bars right? (well fade to white)
regardless.   here is the code for that table  (in fact you can see it if you right click on the page and go to 'View Source')

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td style="background:url(Image1.gif) repeat-x;">&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td style="background:url(Image1.gif) repeat-x;">&nbsp;</td>
    </tr>
</table>
</body>
</html>

the only other reason I can think of is that you have the path to the image wrong.  Does the folder picts reside in the sites root folder?  If so, try to use a / in front of it.
0
 
smaccariCommented:
Try this: (take care too for single and double quotes)

<td style="background-image:url('picts/bluebar.gif');" colspan="3">
0
 
kevp75Commented:
remember.  you still may need to use repeat-x:  background-image:url('picts/bluebar.gif') repeat-x;
0
 
GUEENAuthor Commented:
I had to fix the bottom bar also - you guys are entirely awesome -:)
I am going to give Kev an assist for 100 points for taking the time to test it on his site.
Thank you!
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.shekerra.com%2Ftest2%2F&charset=%28detect+automatically%29&doctype=Inline
0
 
GUEENAuthor Commented:
You'll be seeing me around a lot more now that I have more time for webdev projects!
0
 
kevp75Commented:
np....glad I could help  :)

great...another coder in the scene  ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now