We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Validation fails on attribute - background

GUEEN
GUEEN asked
on
Medium Priority
232 Views
Last Modified: 2013-11-19
Comment
Watch Question

Commented:
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">

Commented:
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
CERTIFIED EXPERT

Author

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>

Commented:
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
CERTIFIED EXPERT

Author

Commented:
as soon as I put that code in - my bar disappears! I am serious.

Commented:
can you tell me what you see on this page:http://www.portalfanatic.com/test8.asp
CERTIFIED EXPERT

Author

Commented:
2 black bars (top)

Commented:
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.
Commented:
Try this: (take care too for single and double quotes)

<td style="background-image:url('picts/bluebar.gif');" colspan="3">

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Commented:
remember.  you still may need to use repeat-x:  background-image:url('picts/bluebar.gif') repeat-x;
CERTIFIED EXPERT

Author

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
CERTIFIED EXPERT

Author

Commented:
You'll be seeing me around a lot more now that I have more time for webdev projects!

Commented:
np....glad I could help  :)

great...another coder in the scene  ;-)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.