Hi all,
I am new to XHTML, since I now discovered many web site are using XHTML + CSS, so I try to make one for myself.
Now, I have a peoblems taked, by after using the W3C's "Validate Your Markup" to check my web page do it valid the XHTML 1.0 Trad or not, it show me this result, can suggest fix it by CSS, but I don't know how to using the CSS to fix it, do anyone can teach me the better way to try for?
Thx
Line 31, column 34: there is no attribute "height"
<table width="500" height="20" border="0" cellpadding="0" cellspacing=".
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.Basically, setting the height or width of anything is considered 'presentational' data. The whole goal of xhtml is to completely strip presentational data out of the markup and move it into a stylesheet.
So instead of what you've got, you'd do this:
Markup:
<link rel="stylesheet" href=http://www.webdeveloper.com/forum/archive/index.php/"style.css" type="text/css" />
<table id="maintable">
...
</table>
And then you'd have a file called 'style.css' which would contain this, among other things:
#maintable {
height: 500px;
width: 200px
}
Now, before everyone jumps on your back about using a table for layout, you might consider checking out tableless layout. It's not easy, and broswers are a pain, but if it's your first one, you could start by ripping off one of the working and tested ones that exists in this reference document: <!-- m --><a class="postlink" href="http://www.glish.com/css/Originally">http://www.glish.com/css/Originally</a><!-- m --> posted by mikepurvis
The whole goal of xhtml is to completely strip presentational data out of the markup and move it into a stylesheet. That's the whole goal of HTML 4.01 Strict and you should be using HTML 4.01 Strict. The whole goal of XHTML is to separate "well formedness" from "validity" so that you can do some error checking without the DTD and so that XHTML can more easily be combined with other mark-up languages.Hey Charles,
Can you explain that a bit more for me?
I've been wondering what the point of XHTML was. I know you can create your own tags, but they don't validate... So, what's going on?
Thanks for your time.See <!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml1/#xhtml">http://www.w3.org/TR/xhtml1/#xhtml</a><!-- m --> .Thanks, but I have read that before... Did I miss the bit where it says why my own tags don't validate?"It is a reformulation of the three HTML 4 document types as applications of XML 1.0 [XML]."
If you write your own elements it will not be valid but it can be "well formed". But you're not supposed to just make up your own elements. Communities are supposed to write mark-up languages to suit their needs; MthML comes to mind. And one can use XHTML as the base for such things as XHTML/MathML. But you would need an XHTML/MathML DTD or schema to test for validity.So, a little person like myself shouldn't worry about xhtml then (although I use an xhtml strict DTD on my pages)? I should just use html 4.01?You will not hurt anyting by using XHTML 1.0 Strict if, and only if, you follow the Compatability Guidelines (<!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml1/#guidelines">http://www.w3.org/TR/xhtml1/#guidelines</a><!-- m -->).Originally posted by Charles
That's the whole goal of HTML 4.01 Strict and you should be using HTML 4.01 Strict. The whole goal of XHTML is to separate "well formedness" from "validity" so that you can do some error checking without the DTD and so that XHTML can more easily be combined with other mark-up languages.
All right then, thanks for the info. However, a CSS newbie's thread may not be the best thread for discussing such things.Mike,
Sorry if this seems like a waste of space to you. I think your answer was good for the poster and Charles was good to expand on it for anyone reading (like myself).
Charles,
Thanks for the pointers.
What I've been thinking about xhtml is that it might be easier to make tags myself and define them in the css rather than use something like <div id="whatever"> - I could just use <whatever></whatever> or something meaningful like the example in the W3C literature about music (<instrument>flute</instrument>).
It seems to me that the internet isn't just about 'communities' - people should be able to take the initiative themselves (of course with the help of good people like yourself).
This brings me back to the question about validation. If a page doesn't validate due to the tags not being standard tags, but the page is well formed as you say, does it matter?
Thanks again for your time.Originally posted by BonRouge
Mike,
Sorry if this seems like a waste of space to you. I think your answer was good for the poster and Charles was good to expand on it for anyone reading (like myself).
Sorry to be short about it. As a frequent question-asker myself, I always get freaked out when someone drops a dump-truck definition that goes way beyond what's applicable in my situation -- sort of overwhelming.
This brings me back to the question about validation. If a page doesn't validate due to the tags not being standard tags, but the page is well formed as you say, does it matter?
In a perfect world, we'd surf XML pages and stylesheets would define based on purely the content pages where everything should go. Sites like the ZenGarden demonstrate that carefully constructed markup can be displayed in almost any way. However, in practice, a redesign of a multipage site is never quite so simple -- the order of the markup, the nesting and placement of auxiliary divs becomes very important.
As it is, you could write your site's entire content in XML, and then employ a simple server-side script that could grab the content and parse it into the tags defined by the XHTML DTD.
RSS is xml, of course, and any site that displays a news feed is basically the above -- taking raw content marked up as something else and turning it into content marked up for a web browser.I think my point is 'why do I need to parse it into xhtml dtd tags when the W3C literature tells us we can make our own tags (which we can - they just don't validate)?' Maybe W3C needs a new validator that will check your xhtml and css at the same time to see if they tally - ie. things like no block-level elements within inline elements - stuff like that.Originally posted by BonRouge
I think my point is 'why do I need to parse it into xhtml dtd tags when the W3C literature tells us we can make our own tags (which we can - they just don't validate)?' Maybe W3C needs a new validator that will check your xhtml and css at the same time to see if they tally - ie. things like no block-level elements within inline elements - stuff like that.
AFAIK, there are xml validators out there... it's just that a web browser can't make any sense of a raw xml doc. A more complex styling language than CSS is necessary to define its appearance.
A generic XML validator would operate using a Document Type Definition, though. Even if you're just making up tags as you go along, to be internally consistent, you want to define which ones the validator is to permit. So you write your own DTD, and then the validator will run your document against it.
At any rate, there's some good discussion on the topic on Zeldman's article about valid doctypes: <!-- m --><a class="postlink" href="http://www.alistapart.com/discuss/doctypeI">http://www.alistapart.com/discuss/doctypeI</a><!-- m --> see (I think). Would it be acceptable to take W3C's dtd and add to it? Is that OK? I don't think I have the ability to do that - I'm not a programmer - but I'm curious.
I am new to XHTML, since I now discovered many web site are using XHTML + CSS, so I try to make one for myself.
Now, I have a peoblems taked, by after using the W3C's "Validate Your Markup" to check my web page do it valid the XHTML 1.0 Trad or not, it show me this result, can suggest fix it by CSS, but I don't know how to using the CSS to fix it, do anyone can teach me the better way to try for?
Thx
Line 31, column 34: there is no attribute "height"
<table width="500" height="20" border="0" cellpadding="0" cellspacing=".
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.Basically, setting the height or width of anything is considered 'presentational' data. The whole goal of xhtml is to completely strip presentational data out of the markup and move it into a stylesheet.
So instead of what you've got, you'd do this:
Markup:
<link rel="stylesheet" href=http://www.webdeveloper.com/forum/archive/index.php/"style.css" type="text/css" />
<table id="maintable">
...
</table>
And then you'd have a file called 'style.css' which would contain this, among other things:
#maintable {
height: 500px;
width: 200px
}
Now, before everyone jumps on your back about using a table for layout, you might consider checking out tableless layout. It's not easy, and broswers are a pain, but if it's your first one, you could start by ripping off one of the working and tested ones that exists in this reference document: <!-- m --><a class="postlink" href="http://www.glish.com/css/Originally">http://www.glish.com/css/Originally</a><!-- m --> posted by mikepurvis
The whole goal of xhtml is to completely strip presentational data out of the markup and move it into a stylesheet. That's the whole goal of HTML 4.01 Strict and you should be using HTML 4.01 Strict. The whole goal of XHTML is to separate "well formedness" from "validity" so that you can do some error checking without the DTD and so that XHTML can more easily be combined with other mark-up languages.Hey Charles,
Can you explain that a bit more for me?
I've been wondering what the point of XHTML was. I know you can create your own tags, but they don't validate... So, what's going on?
Thanks for your time.See <!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml1/#xhtml">http://www.w3.org/TR/xhtml1/#xhtml</a><!-- m --> .Thanks, but I have read that before... Did I miss the bit where it says why my own tags don't validate?"It is a reformulation of the three HTML 4 document types as applications of XML 1.0 [XML]."
If you write your own elements it will not be valid but it can be "well formed". But you're not supposed to just make up your own elements. Communities are supposed to write mark-up languages to suit their needs; MthML comes to mind. And one can use XHTML as the base for such things as XHTML/MathML. But you would need an XHTML/MathML DTD or schema to test for validity.So, a little person like myself shouldn't worry about xhtml then (although I use an xhtml strict DTD on my pages)? I should just use html 4.01?You will not hurt anyting by using XHTML 1.0 Strict if, and only if, you follow the Compatability Guidelines (<!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml1/#guidelines">http://www.w3.org/TR/xhtml1/#guidelines</a><!-- m -->).Originally posted by Charles
That's the whole goal of HTML 4.01 Strict and you should be using HTML 4.01 Strict. The whole goal of XHTML is to separate "well formedness" from "validity" so that you can do some error checking without the DTD and so that XHTML can more easily be combined with other mark-up languages.
All right then, thanks for the info. However, a CSS newbie's thread may not be the best thread for discussing such things.Mike,
Sorry if this seems like a waste of space to you. I think your answer was good for the poster and Charles was good to expand on it for anyone reading (like myself).
Charles,
Thanks for the pointers.
What I've been thinking about xhtml is that it might be easier to make tags myself and define them in the css rather than use something like <div id="whatever"> - I could just use <whatever></whatever> or something meaningful like the example in the W3C literature about music (<instrument>flute</instrument>).
It seems to me that the internet isn't just about 'communities' - people should be able to take the initiative themselves (of course with the help of good people like yourself).
This brings me back to the question about validation. If a page doesn't validate due to the tags not being standard tags, but the page is well formed as you say, does it matter?
Thanks again for your time.Originally posted by BonRouge
Mike,
Sorry if this seems like a waste of space to you. I think your answer was good for the poster and Charles was good to expand on it for anyone reading (like myself).
Sorry to be short about it. As a frequent question-asker myself, I always get freaked out when someone drops a dump-truck definition that goes way beyond what's applicable in my situation -- sort of overwhelming.
This brings me back to the question about validation. If a page doesn't validate due to the tags not being standard tags, but the page is well formed as you say, does it matter?
In a perfect world, we'd surf XML pages and stylesheets would define based on purely the content pages where everything should go. Sites like the ZenGarden demonstrate that carefully constructed markup can be displayed in almost any way. However, in practice, a redesign of a multipage site is never quite so simple -- the order of the markup, the nesting and placement of auxiliary divs becomes very important.
As it is, you could write your site's entire content in XML, and then employ a simple server-side script that could grab the content and parse it into the tags defined by the XHTML DTD.
RSS is xml, of course, and any site that displays a news feed is basically the above -- taking raw content marked up as something else and turning it into content marked up for a web browser.I think my point is 'why do I need to parse it into xhtml dtd tags when the W3C literature tells us we can make our own tags (which we can - they just don't validate)?' Maybe W3C needs a new validator that will check your xhtml and css at the same time to see if they tally - ie. things like no block-level elements within inline elements - stuff like that.Originally posted by BonRouge
I think my point is 'why do I need to parse it into xhtml dtd tags when the W3C literature tells us we can make our own tags (which we can - they just don't validate)?' Maybe W3C needs a new validator that will check your xhtml and css at the same time to see if they tally - ie. things like no block-level elements within inline elements - stuff like that.
AFAIK, there are xml validators out there... it's just that a web browser can't make any sense of a raw xml doc. A more complex styling language than CSS is necessary to define its appearance.
A generic XML validator would operate using a Document Type Definition, though. Even if you're just making up tags as you go along, to be internally consistent, you want to define which ones the validator is to permit. So you write your own DTD, and then the validator will run your document against it.
At any rate, there's some good discussion on the topic on Zeldman's article about valid doctypes: <!-- m --><a class="postlink" href="http://www.alistapart.com/discuss/doctypeI">http://www.alistapart.com/discuss/doctypeI</a><!-- m --> see (I think). Would it be acceptable to take W3C's dtd and add to it? Is that OK? I don't think I have the ability to do that - I'm not a programmer - but I'm curious.