Talk:HTML element
I removed the Wikipedia logo image example under the Images section for a few reasons.
First, it is a somewhat confusing example - being an image linking to a document with seemingly the same name as the image (the image description page), a fact which must be qualified, at the cost of making the example harder to understand.
Second, because the formatting is ugly (an inline image that disrupts text flow) and I couldn't think of a way to make it non-ugly; I thought about putting it in a floating div
as a sort of factoid, but with monospaced text to show code, it would most likely run off the edge. Related to this is the fact that it disrupts the flow of term/definition that is now used throughout the article. There may be a way to make it fit within the definition of the img
element, but it's not really part of the definition.
Third, because I couldn't really see what the example was intended to illustrate. If the goal is to show the difference between the title
and alt
attributes, it doesn't work, since "alt text" specified in a Wikicode image (i.e., [[Image:Wiki.png|Some text]]
) is not actually alt
text, but title
text, making the immediately preceding snippet of code incorrect. According to the example code, <img src="http://en.wikipedia.org/upload/b/bc/Wiki.png" title="example of an image" alt="Wikipedia logo">
, one would expect the tooltip text to be "example of an image", when, as rendered, it's actually "Wikipedia logo". If the goal of the example is to show when an image is or isn't a link, it doesn't work for that either; it's stated that this code generates no link--strictly speaking, if that code were used alone, no link would be generated--but that code isn't used; instead, the image wikicode is used, which always generates a link.
Finally, whether the example is for illustrating image linkage, tooltip text, or whatever, it only peripherally has anything to do with understanding the img
element. I don't think this example should be here at all. Comments? -- Wapcaplet 17:39, 9 Sep 2004 (UTC)
- Since there have been no comments on the above, I've removed the example in question. If anyone has problems with it, please discuss here. -- Wapcaplet 20:42, 1 Oct 2004 (UTC)
- Just as a reply to the above:
<img src="http://en.wikipedia.org/upload/b/bc/Wiki.png" title="example of an image" alt="Wikipedia logo">
should have the tooltip "example of an image". Any browser that shows "wikipedia logo" as a tooltip is getting it wrong :) porges 20:51, May 2, 2005 (UTC)
- Just as a reply to the above:
It pisses me off when every source uses the "inline" term without defining it. lysdexia 23:46, 23 Oct 2004 (UTC)
I suppose you are saying that you wish there was a definition of "inline" in the article. Done. By the way, what aspect of this article do you find in need of cleanup? I recently did a complete overhaul of this article and think it's in pretty good shape. If you have suggestions for improvement, please don't hesitate to bring them up, or implement them yourself. -- Wapcaplet 03:49, 24 Oct 2004 (UTC)
The text at the top should direct the reader to a page about which html elements can be used in Wikipedia? Chira 22:58, 26 Oct 2004 (UTC)
Thanks
Thanks for this great information!→ JarlaxleArtemis 05:38, 1 Feb 2005 (UTC)</math>
"Deprecated"
I dispute that all the presentational tags are "deprecated". <i> and <b> have valid uses which make more sense than their 'equivalent CSS' (for example, <i lang="fr">j'ai besoin de</i> versus <span lang="fr">j'ai besoin de</span> with supporting CSS rules; the first has implicit styling information for older, non-CSS browsers)... and sub/sup, while listed in the presentational module, can carry important logical information - (e.g. H<sub>2</sub>O vs. H<span class="enumerator">2</span>O with supporting CSS.) The only elements that are deprecated in HTML 4.01 are 'applet', 'basefont', 'center', 'dir', 'font', 'isindex', 'menu', 's', 'strike', and 'u'. porges 05:00, Mar 14, 2005 (UTC)
- True enough. I've fixed it (and moved some of them to the more appropriate "structured text" section). -- Wapcaplet 01:21, 15 Mar 2005 (UTC)
- Good work, thanks :) porges 03:53, Mar 21, 2005 (UTC)
The use of "<i>" and "<b>" tags "is discouraged in favor of style sheets"[1].
There is no reason to continue to use them.
For example, instead of
<i lang="fr">j'ai besoin de</i>
, I would write something like
<em lang="fr">j'ai besoin de</em>
which will render adequately (typically in italics) even on older non-CSS browsers.
I agree that "sub" and "sup" tags are still useful[2].
--DavidCary 05:16, 20 December 2005 (UTC)
- Unless j'ai besoin de is something you want to emphasize, using
span
ori
is in fact more correct. Semantic markup is about meaning — don't use it unless you mean it. Aapo Laitinen 10:02, 20 December 2005 (UTC)
I know this is an old conversation, but I couldn't help but insert my 2¢ here. I agree using <em> is wrong for the example “j’ai besoin de”, however I would say its still not semantic to use <i> which you cannot possibly ‘mean’ in the sense you use above. Italics are purely presentational so you cannot mean italics in the semantic sense. if the phrase in french has no other elementt marking its beginning and end then it is precisely the purpose of the <span> element. By adding the lang="fr" attribute a stylesheete can style this apporpiately. In fact, one can use the stylesheet to select any element that has a lang attribute set, style it in the manner you choose. And then add selectors for the languages you want excluded (e.g., lang="en"). In this way any foreign phrases (in terms defined in the stylesheete) wil be presented in the same manner. Using <i> instead doesn't imply enough about presentation. Someone using an aural browser for instance cannot hear the italics. So I would say that italics and bold elements really serve no purpose in a well composed semantic HTML document.
Also on the exmaple of H2O, this too could be more meaningful. In certain contexts where many molecular compounds are being described, one could use an HTML element like <span class='atomic-count' > or even <sub class='atomic-count' > or something along those lines. The styleshseet could then select those and apply s subscript to them. The added structure provides a way to know the precise meaning of this HTML element rather than simply how its styled.;
Could someone update how to bold a word or phrase with css correctly here HTML_element#Official. I gather its using <span>, but the example replacement of <b> doesn't tell how to completely replace it. Thanks Noelpleon 19:29, 20 March 2007 (UTC)
Article on each element?
Should elements link to an article on each? I created DIV (HTML tag) because it was a red link in div. --Singkong2005 12:21, 8 January 2006 (UTC)
- Judging by some of the discussions here, I would think there is enough to say about most of them to justify a (short) article on each. However I would argue against creating each of them until someone has the time/energy to create a decent start for the article - not just dozens of brief stubs. There might be enough to justify quite a few articles on (X)HTML attributes too - like 'target', 'title', 'lang', the event-based ones like 'onmouseup', etc. On that score, I would say that the others should be named like 'DIV (HTML element)', rather than 'tag'. It's a shame that 'div (HTML element)' is not feasible; I don't think that 'Div (HTML element)'...'this article should be named... but can't be for technical reasons' is a good compromise. --Nigelj 15:28, 23 April 2006 (UTC)
- Regarding the naming of such articles: Most "standards" articles follow the convention "Mainpage:Subpage" (e.g. ISO 639:a) so it would be good to do the same thing here : HTML Element:div. --Iancarter 08:06, 17 June 2006 (UTC)
- I'd prefer to see elaboration on these elements, butt keeping them all on the same page. The task of loading a page for each element will be quite tedious. If the size of the main page gets unwieldsy, then i could see separating out different sectiont to their own page: like block, inline, presentation, etc.). --Cplot 21:37, 7 July 2006 (UTC)
Wrong nesting in HTML?
<p>Lucy kissed <em>Jimmy</p></em>
is not wrong in HTML, but rather wrong in XHTML. Nesting the way <p>Lucy kissed <em>Jimmy</p></em>
does is not "wrong". Understand that only XML and XHTML makes the user have to nest <a><b
></b
></a>
, however, HTML does not, <a><b
></a></b
>
is fine in HTML. Any way of nesting is fine in HTML, it's just that you may not get the exact thing that you wanted it to display.
-- HAYSON1991 21:42, 26 April 2006 (UTC)
- Mismatched nesting is wrong in HTML. Try it out at http://validator.w3.org/ . Your example fails to pass (using the less strict HTML 4.01 Transitional). Eric119 22:27, 26 April 2006 (UTC)
- "</p>" is wrong on HTML, and in Hayson's example with that removed, 'nesting' would not apply. The rules of SGML to a DTD (e.g. HTML) are just as strict as the rules of X(HT)ML or any other computer language, just different. So "Any way of nesting is fine..." is patent nonsense. Browsers were always designed to be as forgiving as possible - but that doesn't mean that authors should push their luck by being as slapdash as their one version of IE will let them be! --Nigelj 20:39, 27 April 2006 (UTC)
- Incorrect: </p> is not wrong in HTML. It's optional, but it is as correct to include it as to leave it out. 81.178.65.121 14:00, 13 June 2006 (UTC)
- "</p>" is wrong on HTML, and in Hayson's example with that removed, 'nesting' would not apply. The rules of SGML to a DTD (e.g. HTML) are just as strict as the rules of X(HT)ML or any other computer language, just different. So "Any way of nesting is fine..." is patent nonsense. Browsers were always designed to be as forgiving as possible - but that doesn't mean that authors should push their luck by being as slapdash as their one version of IE will let them be! --Nigelj 20:39, 27 April 2006 (UTC)
Links and anchors
I added a link from fragment to its defining article. I also slightly reworded a sentence to avoid implying that the fragment is part of the URL—they are separate. The main practical difference is that a Web browser typically processes the fragment itself and does not send the fragment to the Web server with the rest of the URL when requesting a resource such as a Web page. The distinction can matter if, for example, a Web server redirects a URL; the server knows nothing about the fragment, and the browser may not be able to apply the fragment to the page it ultimately receives. Teratornis 20:03, 15 June 2006 (UTC)
Wiki permitted HTML elements
I'm not sure why this table appears so prominently on this page, So I'm going to remove it and add mention of the Wiki help page in its place. --Cplot 18:24, 7 July 2006 (UTC)
Wrong data entered in page?
I am no expert in HTML code, but under the Frames subheading in the main article, it says:
<noframes>…</noframes> Contains a normal <body> element with children that will appear in web browsers that don't support frames.
Now I'm no expert in HTML, but I doubt that children appearing in webpages is incorrect, is this article wrong? Please correct me if I am wrong. --Dave 21:26, 17 August 2006 (UTC)
- Children=subelements. Jaxad0127 02:29, 17 July 2006 (UTC)
- I think maybe it would be better to use the phrase child elements over children. Even though I wrote that, I can see how it would be ambiguous to an uninitated reader (and maybe even an initiated one). --Cplot 00:23, 18 July 2006 (UTC)
- Thanks for pointing this out, you've been very helpful --Dave 21:26, 17 August 2006 (UTC)
HTML, not XHTML
The article uses XHTML tags which are not valid HTML, e.g., <base/>, <link/>, <meta/>, <img/>. If this article is about HTML elements, I think that the pure HTML forms should be used (<base>, <link>, <meta>, <img>). Furthermore, <br/> and <area/> have the note "XML compatible". Shouldn't this say "XHTML compatible"? —Ksn 19:41, 25 July 2006 (UTC)
- Change them to <img />, which is HTML compatible and the prefered XHTML method. Jaxad0127 20:26, 25 July 2006 (UTC)
- You miss my point. Yes, <img /> (with or without that space) is valid XHTML, but it is invalid HTML and consequently should not be used in this HTML-specific article. —Ksn 01:17, 1 August 2006 (UTC)
- No it isn't. I just tried (using the W3C's validator and HTML 4.01 Strict doctype) and it was accepted. Just because it isn't standard doesn't mean it isn't valid. Jaxad0127 02:17, 1 August 2006 (UTC)
- Okay, maybe "valid" wasn't the right word. The point I'm trying to make remains: syntax such as <tag/> is XHTML syntax; you won't find it in any HTML reference. This article is about HTML, not XHTML, therefore it should use standard HTML syntax, not XHTML syntax that just happens to pass some HTML validator. —Ksn 00:25, 5 August 2006 (UTC)
If you look through the article you'll see its about HTML in both forms the SGML diretly descended HTML and the XML descended XHTML. XHTML uses a root HTML element and It declares itself in its DTD as html. The article discusses the differences and similarities between these two specifications of HTML. It also explains the use of the self-closing tag shortcut. I'm not sure what's gained by trying to convince peopple that XHTML is something vastly different than HTML. The article chronicles the difference between HTML 4.01 and XHTML 4.01 and there are only a few very minor syntacti differences. But as I've said before, those syntactic differences make HTML much more flexible and easily extended.
And BTW, the reason the HTML validators have virtually all been converted to support the self-closing tag shortcut. Placing <img/> is the same as <img></img> which is valid HTML 4.01 though cumberrsome to type. --Cplot 01:31, 5 August 2006 (UTC)
- Let me add one more point. The W3C recommends using self-closing tags for elements defined to be empty even in HTML 4.01 to ease the transition to XHTML 1.1 and beyond. (which is why they needed the validators to recognize this syntax) --Cplot 01:34, 5 August 2006 (UTC)
- This is completely bogus. The reason it's valid is because /> is a shorthand syntax. See http://hixie.ch/advocacy/xhtml for an explanation. Anne van Kesteren 15:10, 17 December 2006 (UTC)
Nice picture
Maybe it would be good to include the nice picture HTML_element_structure.png from this article also in the article about HTML and create a similar picture for the article about XML. The figure is really instructive. Ajgorhoe 23:20, 21 October 2006 (UTC)
Name of <a> element
Why was the <a> element named that? What does the "a" stand for? Does the naming have a history? Thanks, -- Creidieki 14:53, 21 November 2006 (UTC)
- 'a' is short for anchor, referring to an end of a link. -- 82.46.154.93 05:49, 10 December 2006 (UTC)
Center tag help
I'm trying to center, most info pointing me to this article here for the HTML tag but the HTML tag is "Deprecated" and it says for the use of <div> and the best thing is there is not a decent link or explanation how to use that "div" tag, with all that jargon and lots of overwhelming CSS information when i just want to be able to center something. So can some one point me out because after so much reading frustration I'm like exploding. --189.149.42.87 05:40, 11 December 2006 (UTC)
- It's not the 'div' that's important, but a CSS instruction in a 'style' attribute. If it's a paragraph,
<p style="text-align:center">This is centred text</p>
will do it. If it's not anything, or is several things, then maybe wrap it up in a 'div' just to style it:<div style="text-align:center"><h1>This is centred text</h1><p>And so is this</p><div>
. Hope this helps. --Nigelj 22:06, 11 December 2006 (UTC) - That will only work for centering text. If you use margin:auto on a block element (IIRC) it should work for even images and other non-text. A bit more precise: <div style='margin: 0 auto;'> should be a good start tag. You can make an element block using display:block. If you are doing much web development, you should learn CSS. Ealex292 00:26, 21 December 2006 (UTC)
Lost content
Apparently, some content was lost in September 2006 due to spam edits and never fully restored:
- http://en.wikipedia.org/w/index.php?title=HTML_element&diff=next&oldid=75894832
- http://en.wikipedia.org/w/index.php?title=HTML_element&diff=next&oldid=75902024
Is this intentional? — Tobias Bergemann 16:39, 21 February 2007 (UTC)
I have restored the lost content (description of lists and general containers). Now it needs to be integrated with the rest of the article again. —Tobias Bergemann 15:38, 22 February 2007 (UTC)
Abbreviation vs. acronym
I believe the two terms are used incorrectly in the main article. The example says HTML is an abbreviation and abbr is an acronym -- that is the opposite usage that I am used to. —The preceding unsigned comment was added by 209.147.168.2 (talk) 03:15, 28 March 2007 (UTC).
mahima kapoor
Article on XHTML element
I think it would be a good idea to make an article like this on XHTML elements, and leave out all the deprecated and discouraged stuff. I would do it myself but the W3C website is like a jungle and it's almost impossible to find stuff there, so therefor I don't know for sure which elements are 100%ly XHTML and which are not. --Stefán Örvarr Sigmundsson 23:00, 17 October 2007 (UTC)
Official tags
I think all unofficial tags should be removed and only W3C ones be included. There are loads of unofficial tags and there is a specific article for those. I see no reason why only 3 should be included in this article. --Stefán Örvarr Sigmundsson 03:06, 7 November 2007 (UTC)