Click here to get back home

how can I validate with these lines of HTML?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
how can I validate with these lines of HTML? Steve 05-14-2005
Posted by Steve on May 14, 2005, 7:13 pm
Please log in for more thread options


Hi,

[1]

I have the below line in every page of a site, to set up the top section of
the page:

<table width="100%" cellspacing="0" cellpadding="0"
background="images/index_topstrip.gif">

The HTML validator is failing the part:

background="images/index_topstrip.gif"

The statement clearly works or my site wouldn't look the way it does.

Can anyone tell me how to alter the code to pass validation, r an
alternative way to do this?

(It is tiling a small verticle image across the top of the page in a table.
I'm using the table to stop it tiling all the way down the page.)

[2]
I also set up some text 'buttons' in a table on each page like this:

<table width="135" border="1" cellspacing="0" cellpadding="3">
<tr>
<td align="center" valign="middle" bordercolor="#0033CC"
bgcolor="#84D6F7" class="style3"><a href="index.html">Home</a></td>
</tr>

The validator is failing this bit:
bordercolor="#0033CC"

again which works fine.
Is there a way I can do something else to keep the effect but validate.

The site is using a stylesheet, so if I can do both in a stylesheet, that
would be cool.

thanks





Posted by kchayka on May 14, 2005, 4:42 pm
Please log in for more thread options


Steve wrote:
>
> I have the below line in every page of a site...

Please post a URL. It is sooooooooooo much easier (for us) to work with
a complete web page rather than code snippets that we have to try to
decipher first.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.

Posted by Jukka K. Korpela on May 15, 2005, 10:56 am
Please log in for more thread options



> I have the below line in every page of a site, to set up the top
> section of the page:
>
> <table width="100%" cellspacing="0" cellpadding="0"
> background="images/index_topstrip.gif">

Then fix it.

> The HTML validator is failing the part:
>
> background="images/index_topstrip.gif"

No, it's the part that is failing.

> The statement clearly works or my site wouldn't look the way it
> does.

For odd values of "work". It's not a statement, by the way. And your
statement about its "working" indicates lack of testing.

> Can anyone tell me how to alter the code to pass validation

Remove the offending attribute.

> , r an alternative way to do this?

Depends on what "this" is. You can suggest a background image in CSS.
You would need to learn the basics of CSS and robust design first.
Such as the principle of always setting text and background color and
link colors inside an element if you set background image for it.

But what you asked in the Subject line can be answered as follows: they
cannot be validated as HTML since they are not HTML as defined in the
specifications, but you can validate them as "HTML" in a loose sense by
writing an SGML or XML DTD that allows the attribute you use. I just
sent you a DTD by E-mail for this. Oops, it bounced back. Sorry, I
deleted it already. Better luck next time, and consider getting a clue
about forged From lines.

> (It is tiling a small verticle image across the top of the page in
> a table. I'm using the table to stop it tiling all the way down the
> page.)

Stop doing so. Write a valid HTML document, then study CSS to see how
to suggest adding such presentational features. If problems remain, ask
in c.i.w.a.stylesheets, and don't forget to post a URL.

> I also set up some text 'buttons' in a table on each page like
> this:

Use CSS instead.

> The validator is failing this bit:
> bordercolor="#0033CC"

No, it does what you asked it to do: report violations of the formal
syntax that your document purports to comply with.

> The site is using a stylesheet, so if I can do both in a
> stylesheet, that would be cool.

Surely you can. But first get rid of the current trickery, and make
sure that the page works well without any stylesheet, or with any
reasonable stylesheet.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


Posted by David Ross on May 15, 2005, 11:27 am
Please log in for more thread options


Steve wrote:
>
> Hi,
>
> [1]
>
> I have the below line in every page of a site, to set up the top section of
> the page:
>
> <table width="100%" cellspacing="0" cellpadding="0"
> background="images/index_topstrip.gif">
>
> The HTML validator is failing the part:
>
> background="images/index_topstrip.gif"
>
> The statement clearly works or my site wouldn't look the way it does.
>
> Can anyone tell me how to alter the code to pass validation, r an
> alternative way to do this?
>
> (It is tiling a small verticle image across the top of the page in a table.
> I'm using the table to stop it tiling all the way down the page.)
>
> [2]
> I also set up some text 'buttons' in a table on each page like this:
>
> <table width="135" border="1" cellspacing="0" cellpadding="3">
> <tr>
> <td align="center" valign="middle" bordercolor="#0033CC"
> bgcolor="#84D6F7" class="style3"><a href="index.html">Home</a></td>
> </tr>
>
> The validator is failing this bit:
> bordercolor="#0033CC"
>
> again which works fine.
> Is there a way I can do something else to keep the effect but validate.
>
> The site is using a stylesheet, so if I can do both in a stylesheet, that
> would be cool.
>
> thanks

Don't use a table for this. Use a style-sheet to create a box at
the top of the page, a box that has your background image.

Just because some browsers make sense of invalid HTML does not make
the HTML valid. Other browsers might not be so loose.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.


Posted by dwight.stegall on May 18, 2005, 3:06 pm
Please log in for more thread options


Do yourself a favor and learn XHTML and stop using tables. Instead use
CSS Box Model. Here is a page I wrote that simulates table cells using
div tags.

http://dwight.tendirect.com/colorsafeie-2.htm

Div tags allow better accessibility to your site than tables and load a
lot faster.


Similar ThreadsPosted
Lenth of lines in html source? July 7, 2008, 9:33 pm
Blank lines and paragraph break in html May 10, 2007, 10:31 pm
html doesn`t validate June 7, 2007, 7:18 am
Re: How can I programmatically validate html ? July 31, 2008, 7:01 pm
How to validate HTML with variables in link? August 16, 2004, 1:35 am
Table without lines June 12, 2008, 12:15 pm
Firefox doesn't break lines at hyphens August 30, 2004, 9:17 am
Allowing lines to break at hyphens? November 15, 2004, 3:23 pm
Two lines of text in inline context September 1, 2005, 5:40 am
White space, new lines in tags March 25, 2006, 1:52 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap