PDA

View Full Version : Xhtml question


fjp800
12-30-2008, 09:26 PM
I am new to this and when I validated my pages I got the following errors:

Line 15: The tag:"body" is not allowed within: "head" It is only allowed within: html.[XHTML 1.0 transitional]

Line 15 presently reads:<body background="images/imagesleaf background.jpg" style="background-attachment:fixed">

line 31: the tag "table" does not have an attribute: "height" in currently active versions.[XHMTL 1.0 transitional]
The tag: "table" doesn't have an attribute: "bordercolor" in currently active versions.[XHTML 1.0 transitional]
Line 31 presently reads: <table width="750" height="850" border="15" align="center" cellpadding="20" cellspacing="0" bordercolor="#006600">

Line 33: The tag: "th" doesn't have an attribute: "bordercolor" in currently active versions.[XHTML 1.0 transitional]
Line 33 presently reads: <th align="center" valign="top" bordercolor="#006600" bgcolor="FFD9B3" scope="col"><p align="center"><img src="urefillit/images/webpagepicture.jpg" alt="banner" width="861" height="158" /></p>

Line 52: The tag: "input" doesn't have an attribute: "border" in currently active versions.[XHTML 1.0 transitional]
Line 52 presently reads: "http://images.paypal.com/images/view_cart_02.gif" border="0" alt="Make payments with PayPal - it's fast, free and secure!" align="middle" />

Any help will be appreciated and I will be able to fix the other errors based on the info I receive...Hopefully..:roll:

Thank you!!

domedia
12-31-2008, 03:52 AM
Read the errors carefully because they tell you what is actually wrong:
1. You cannot have a body tag inside your head tag
2. 'bordercolor' and 'height' are not allowed attributes for TABLE if you write xhtml
3. The tag TH cannot have an attribute called 'bordercolor' in XHTML
4. The tag INPUT cannot have an attribute called 'border' in XHTML

Fixes:
1. Is a structural error, make sure the HEAD tag is closed before you open the BODY tag. The other errors can be fixed by using CSS instead of using outdated HTML attributes.

Corrosive
12-31-2008, 06:05 AM
I am new to this and when I validated my pages I got the following errors:

Line 15: The tag:"body" is not allowed within: "head" It is only allowed within: html.[XHTML 1.0 transitional]

Line 15 presently reads:<body background="images/imagesleaf background.jpg" style="background-attachment:fixed">

line 31: the tag "table" does not have an attribute: "height" in currently active versions.[XHMTL 1.0 transitional]
The tag: "table" doesn't have an attribute: "bordercolor" in currently active versions.[XHTML 1.0 transitional]
Line 31 presently reads: <table width="750" height="850" border="15" align="center" cellpadding="20" cellspacing="0" bordercolor="#006600">

Line 33: The tag: "th" doesn't have an attribute: "bordercolor" in currently active versions.[XHTML 1.0 transitional]
Line 33 presently reads: <th align="center" valign="top" bordercolor="#006600" bgcolor="FFD9B3" scope="col"><p align="center"><img src="urefillit/images/webpagepicture.jpg" alt="banner" width="861" height="158" /></p>

Line 52: The tag: "input" doesn't have an attribute: "border" in currently active versions.[XHTML 1.0 transitional]
Line 52 presently reads: "http://images.paypal.com/images/view_cart_02.gif" border="0" alt="Make payments with PayPal - it's fast, free and secure!" align="middle" />

Any help will be appreciated and I will be able to fix the other errors based on the info I receive...Hopefully..:roll:

Thank you!!

Hi Frank

I e-mailed you back last night. Let me know if you got it. Thanks

fjp800
12-31-2008, 02:58 PM
Hello Corrosive,

I did not get the e-mail. However, I did notice that perhaps I was using the wrong validation. My document reads: <!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">.. Therefore, I selected the document type as XHTML 1.0 Transitional for validation and got only four errors. All having to do with CSS. However, I dont know how to configure the CSS style sheet for a particular line[s]. Example: Line 33, Column 30: there is no attribute "height". <table width="750" height="850" border="15" align="center" cellpadding="20"

If I can be guided how to fix this one, I will be able to fix the other three errors. Thank you Frank

Corrosive
12-31-2008, 03:01 PM
That's odd. I'll PM you on here instead.

domedia
12-31-2008, 05:11 PM
owever, I dont know how to configure the CSS style sheet for a particular line[s]. Example: Line 33, Column 30: there is no attribute "height". <table width="750" height="850" border="15" align="center" cellpadding="20"

If I can be guided how to fix this one, I will be able to fix the other three errors. Thank you Frank
There is no such attribute for TABLE. Remove it.

fjp800
12-31-2008, 09:15 PM
I was able to remove all the errors and had the site spidered.. All four pages were spidered. Thank you for your help!!!!

Corrosive
01-01-2009, 06:14 AM
I was able to remove all the errors and had the site spidered.. All four pages were spidered. Thank you for your help!!!!

I'm not quite sure what you mean by spidered but it sounds ok. If you are concerned with how a search engine (spider) will see your site you really need to move away from tables and use a correctly marked up, CSS based layout. It will make a lot more sense to spiders and also users with screen readers.

fjp800
01-01-2009, 01:33 PM
I'm not quite sure what you mean by spidered but it sounds ok. If you are concerned with how a search engine (spider) will see your site you really need to move away from tables and use a correctly marked up, CSS based layout. It will make a lot more sense to spiders and also users with screen readers.

Sorry.. As mentioned before.. I am new at this.. really new at it.Spidered = indexed.


Re: CSS layout: To do this would I have to completety redo my site? Or Can I simply take out the tables?

Also, I only have two tables.... one over the fixed background and the other is the navigation bar.. Can I remove them, use layers and be OK?

Thank you,
Frank


Thank you,
Frank

Corrosive
01-01-2009, 01:39 PM
Sorry.. As mentioned before.. I am new at this.. really new at it.Spidered = indexed.

No problem. Just bear in mind that just because a spider can enter a page it doesn't mean it's good or will do well in Search Engines.

Re: CSS layout: To do this would I have to completety redo my site? Or Can I simply take out the tables?

You'd have to rebuild it I'm afraid. Worth doing and learning though.

Also, I only have two tables.... one over the fixed background and the other is the navigation bar.. Can I remove them, use layers and be OK?

Try not to use layers or apdivs. Use div tags and relative positioning.

fjp800
01-02-2009, 12:12 AM
No problem. Just bear in mind that just because a spider can enter a page it doesn't mean it's good or will do well in Search Engines.



You'd have to rebuild it I'm afraid. Worth doing and learning though.



Try not to use layers or apdivs. Use div tags and relative positioning.

Thank you for the information. I found that I was able to convert the tables to layers.... Now, I have to learn to use div tags, etc. Which I will do. What is the advantage of using div tags, etc over css layers?

Frank

Corrosive
01-02-2009, 07:02 AM
Thank you for the information. I found that I was able to convert the tables to layers.... Now, I have to learn to use div tags, etc. Which I will do. What is the advantage of using div tags, etc over css layers?

Frank

Relative positioning means that each div or section of your site is a part of the 'flow' of the site. All the pieces are relative to each other. Say you have two divs on top of each other, if you add text to the top one it will foce the one underneath down as content is added. Apdivs or layers don't work this way. If you add content to the one above it will flow over the next layer and will look terrible.

This might not sound like an issue if your site stays the same but you must remember that some users need a larger text size when viewing sites and this can break your design if you use layers.

Use divs and relative positioning for the structure of your website.