|
-
Jun 11th, 2004, 09:03 AM
#1
XHTML vs. HTML [Resolved]
I need to be 100% sure on the diffrence tomorrow. Our teacher is not good to explain it. But at the moment I know that.
HTML:
<BR>
XHTML:
<br />
In XHTML all the tags has to be with small letters:
<a> and so on.
And then there is some thing with a / in the end of the tags. Any one care to elaborate on that, or show me a good link about the diffrences?
Last edited by NoteMe; Jun 11th, 2004 at 10:02 AM.
-
Jun 11th, 2004, 09:25 AM
#2
Frenzied Member
Well, the main difference really is that XHTML is more structured, and looks more like XML.
The <a /> is basically if you make an anchor without any text inbetween the two tags and you want to end it off quick.
and yes, XHTML is all lowercase, remember that!(unless it's in attributes(" "))
XHTML is basically clean and structered HTML, which doesn't allow for errors.
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Jun 11th, 2004, 09:35 AM
#3
Originally posted by vbNeo
The <a /> is basically if you make an anchor without any text inbetween the two tags and you want to end it off quick.
So is this an example of this?
<a input type="checkbox" checked="checked" />
???
Originally posted by vbNeo
and yes, XHTML is all lowercase, remember that!(unless it's in attributes(" "))
What do you mena in atributes. Like normal text, or like in the exampel:
<a input type="checkbox" checked="checked" />
can I have uppercase here?Like this?
<a input type="checkbox" Checked="Checked" />
Didn't sound right.
Or maybe you mean like for Divs?
<div class="SOMETHING"> </div>
didn't sound right that either....or are you just talking plain text that will be on the web site?
-
Jun 11th, 2004, 09:49 AM
#4
Frenzied Member
Well, What I mean with attributes is a decription, value for example:
<input type="text" name="txt1" value="ThisIsATextBox" />
AFAIK the values that are shown to the user can be whatever case they want, as long as they're inside " ", while the type value has to be lowercase.
I'd recommend taking the www,w3schools.com quiz on XHTML....
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Jun 11th, 2004, 09:59 AM
#5
Acceptable: <div id="ICanUseUpperHerer"></div>
Unacceptable: <DIV ID="ICanUseUpperCaseHere"></div>
tag names and attribute names should be all lower case. Attribute _values_ can be mixed.
Also XHTML uses CSS for styling. So it won't allow the style attribute in any tag.
XHTML also is much more strict than HTML when it comes to ampersands and entity characters (like the copyright or the trademark symbols.)
TG
-
Jun 11th, 2004, 10:02 AM
#6
Originally posted by techgnome
Acceptable: <div id="ICanUseUpperHerer"></div>
Unacceptable: <DIV ID="ICanUseUpperCaseHere"></div>
tag names and attribute names should be all lower case. Attribute _values_ can be mixed.
Also XHTML uses CSS for styling. So it won't allow the style attribute in any tag.
XHTML also is much more strict than HTML when it comes to ampersands and entity characters (like the copyright or the trademark symbols.)
TG
OK...thanks...things getting clearer now.
-
Jun 11th, 2004, 10:02 AM
#7
Originally posted by vbNeo
Well, What I mean with attributes is a decription, value for example:
<input type="text" name="txt1" value="ThisIsATextBox" />
AFAIK the values that are shown to the user can be whatever case they want, as long as they're inside " ", while the type value has to be lowercase.
I'd recommend taking the www,w3schools.com quiz on XHTML....
Thanks to you too. Will take that quiz later today. Thanks for the hint.
-
Jun 11th, 2004, 01:12 PM
#8
Originally posted by techgnome
Also XHTML uses CSS for styling. So it won't allow the style attribute in any tag.
The style is part of the CSS specification. and is perfectly valid in XHTML.
The following page is valid XHTML and contains a style attribute:
http://www.codedv.com/adam/xhtml.html
-
Jun 11th, 2004, 01:17 PM
#9
Originally posted by visualAd
The style is part of the CSS specification. and is perfectly valid in XHTML.
The following page is valid XHTML and contains a style attribute:
http://www.codedv.com/adam/xhtml.html
Yeah I just read abou that. And that it has the highest presidens of all the styles. But I have also heard that if you are using both methods you can confuse IE...never seen that for my own eyes tho'...
-
Jun 11th, 2004, 01:24 PM
#10
Frenzied Member
Originally posted by NoteMe
Yeah I just read abou that. And that it has the highest presidens of all the styles. But I have also heard that if you are using both methods you can confuse IE...never seen that for my own eyes tho'...
Might be because it's just a browser, that parses a file and therefore is not capable of a human thing such as getting confused ? =)
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Jun 11th, 2004, 01:26 PM
#11
Originally posted by NoteMe
Yeah I just read abou that. And that it has the highest presidens of all the styles. But I have also heard that if you are using both methods you can confuse IE...never seen that for my own eyes tho'...
The style attribute takes precedance over all the other styles and overrides them.
I don't see why IE should worry about it. As long as you include the DOCTYPE at the top of the page IE should render it OK.
But this is Internet Explorer so nothing is surprising
-
Jun 11th, 2004, 01:27 PM
#12
-
Jun 13th, 2004, 11:08 AM
#13
There are two levels of differences between HTML and XHTML.
First, the syntactical/structural. That's the stuff that has been handled and is due to the underlying meta-language, SGML vs XML: all tags must have a matching end tag or be directly closed (/>). All tag names and attribute names are lowercase, some predefined attribute values are case-sensitive too, like the type attribute of input. Attribute values must have quotes around them. Tags must be well-nested, <em>asd<strong>as</em>po</strong> is not allowed.
Then there's the design philosophy level. XHTML follows the same philosophy as HTML 4 Strict, that is, the (X)HTML is only to give the document structure. Semantical markup. HTML was originally conceived to give parts of the text semantical meaning, to indicate the parts that are paragraphs, those that are emphasized, strongly emphasized, code, user input, ...
Extensions during the browser wars brought style to HTML. Tables for layout, <b>, <i>, <font>.
HTML 4 Strict and XHTML feature a return to the basics. They don't have the presentational elements and attributes anymore (XHTML 1.0 Transitional still has them, and there's a presentation module in the modularized XHTML 1.1) but instead rely completely on external style sheets (usually CSS) to give the page presentation.
That's the idea.
And yes, IE can get confused. The way the word is usually applied to computers and software, anyway.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 13th, 2004, 11:34 AM
#14
Yeah thanks for that. I am pretty new to this, so I still can't see the whole point about having diffrent types of DTD(was that was it was called) like strickt and transitional and so on. But I don't think I will get questions about that.
But there is an other thing. Not sure if it has something to do with XHTML, but in the quiz it said that atribute "minimazation" is not allowed in XHTML. And I think that the validator are complaining about href becuase of this:
an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
<a class="linker" href=cd2.php?CDID=44>Les Mer</a>
Can anyone correct this line so it is true XHTML? I thought this was prefecctly legal....
-
Jun 13th, 2004, 12:48 PM
#15
Originally posted by NoteMe
<a class="linker" href=cd2.php?CDID=44>Les Mer</a>
Can anyone correct this line so it is true XHTML? I thought this was prefecctly legal....
The href attribute value needs to be enclosed in quotes:
Code:
<a class="linker" href="cd2.php?CDID=44">Les Mer</a>
-
Jun 13th, 2004, 02:55 PM
#16
but in the quiz it said that atribute "minimazation" is not allowed in XHTML.
That's a two-part issue.
One part is the quote stuff already mentioned.
The other is about enum values that have only one possible value, such as the selected attribute on <option>. It is declared as an #IMPLIED (= optional) attribute of type (selected), i.e. an enum with its only valid value being "selected".
Now, HTML allows such attributes to omit the value, e.g.
<option selected>
That's not allowed in XHTML, you must write the full
<option selected="selected">
Stupid, I know.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 13th, 2004, 03:29 PM
#17
Originally posted by CornedBee
That's a two-part issue.
One part is the quote stuff already mentioned.
The other is about enum values that have only one possible value, such as the selected attribute on <option>. It is declared as an #IMPLIED (= optional) attribute of type (selected), i.e. an enum with its only valid value being "selected".
Now, HTML allows such attributes to omit the value, e.g.
<option selected>
That's not allowed in XHTML, you must write the full
<option selected="selected">
Stupid, I know.
Actualy, I don't find it that stupid....well it is more to write, but it looks cleaner. it's some how a bit similar to write $ and % and so on in stead of Stringg, Souble and so on. I like it to be clean.
Tahnks for the explenation...
-
Jun 13th, 2004, 03:30 PM
#18
Originally posted by visualAd
The href attribute value needs to be enclosed in quotes:
Code:
<a class="linker" href="cd2.php?CDID=44">Les Mer</a>
Off course..
I thought it was more the haw I added the whole href, like it should have been an other word or something..
Thanks.
-
Jun 13th, 2004, 03:37 PM
#19
<a class="linker" href="cd2.php?CDID=44">Les Mer</a>
This narrowly avoids another issue. If the URL was
cd2.php=CDID=44&inquirer=100
then the tag would have to be (and I have to be careful now with vBulletin transformations)
<a class="linker" href="cd2.php?CDID=44&amp;inquirer=100">Les Mer</a>
Edited, it's now completely correct. This applies to HTML as well, btw.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 13th, 2004, 06:12 PM
#20
Thanks didn't think of that "scenario" at all. Well my head is full of XHTML, CSS, PHP, and JS now. So I am on my way to bed, and tomorrow is the big day.
Thanks to all of you who has helped me.
ØØ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|