[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Validation fails on attribute - background

Posted on 2006-04-04
13
Medium Priority
?
213 Views
Last Modified: 2013-11-19
0
Comment
Question by:GUEEN
  • 7
  • 5
13 Comments
 
LVL 25

Expert Comment

by:kevp75
ID: 16375679
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
 
LVL 25

Expert Comment

by:kevp75
ID: 16375691
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
 
LVL 16

Author Comment

by:GUEEN
ID: 16375839
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 25

Expert Comment

by:kevp75
ID: 16376036
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
 
LVL 16

Author Comment

by:GUEEN
ID: 16376065
as soon as I put that code in - my bar disappears! I am serious.
0
 
LVL 25

Expert Comment

by:kevp75
ID: 16376138
can you tell me what you see on this page:http://www.portalfanatic.com/test8.asp
0
 
LVL 16

Author Comment

by:GUEEN
ID: 16376196
2 black bars (top)
0
 
LVL 25

Expert Comment

by:kevp75
ID: 16376338
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
 
LVL 9

Accepted Solution

by:
smaccari earned 1600 total points
ID: 16377131
Try this: (take care too for single and double quotes)

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

Assisted Solution

by:kevp75
kevp75 earned 400 total points
ID: 16377176
remember.  you still may need to use repeat-x:  background-image:url('picts/bluebar.gif') repeat-x;
0
 
LVL 16

Author Comment

by:GUEEN
ID: 16377195
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
 
LVL 16

Author Comment

by:GUEEN
ID: 16377199
You'll be seeing me around a lot more now that I have more time for webdev projects!
0
 
LVL 25

Expert Comment

by:kevp75
ID: 16377407
np....glad I could help  :)

great...another coder in the scene  ;-)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

873 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