This topic has been closed. No new entries allowed.
Reason: You can now post comments on articles on Dev Opera
You need to be logged in to post in the forums. If you do not have an account, please sign up first.
21: Lesser-known semantic elements
This article covers the less common semantic elements in HTML, that exist to identify specific common types of content - contact information, citations, abbreviations, superscript and subscript, insertions and deletions, line breaks, and more.( Read the article )
This has been playing on my mind for some time now - but regarding how to indicate what language code is written in - there is, kinda a way to do it.
Why can't we use the 'lang' attribute? It's valid and we can make use of the 'x-' experimental value:
<code lang="x-javascript">(function () { /* do stuff */ })()</code>
http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang
What are people's thought/feelings on this?
Why can't we use the 'lang' attribute? It's valid and we can make use of the 'x-' experimental value:
<code lang="x-javascript">(function () { /* do stuff */ })()</code>
http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang
What are people's thought/feelings on this?
8. July 2008, 16:16:38 (edited)
Originally posted by remysharp:
Why can't we use the 'lang' attribute?
Because it is explicitly marked as being for natural languages and not for computer languages.
See http://www.w3.org/TR/html4/struct/dirlang.html#h-8.1.1
I'd stick to class names for this (which has the advantage of allowing things such as <code class="javascript language-keyword"> for syntax highlighting)
David Dorward
http://dorward.me.uk/
http://dorward.me.uk/
Originally posted by mnfrancis:
In the following example, the address is contained within the footer paragraph and simply links to another page on the site.
( Read the article )
Unfortunately the address element is defined as a block and may not be a child element of paragraphs (at least in HTML 4.01 Strict).
David Dorward
http://dorward.me.uk/
http://dorward.me.uk/
I'm sad to see that this article repeats the false notion that <var> is meant for marking up variables in programming languages. It's not. Think about it: why would one invent an element type for variables, but not one for constants, one for functions, one for classes, etc.?
No, <var> is meant for marking up variable parts of an expression, usually an example. It's a placeholder; something that shows that a real value should be substituted when used in a concrete situation.
Like when you're explaining how employees' email addresses are made up: <var>firstName</var>.<var>lastName</var>@example.com.
Or like this, "redirect your telephone by pressing <kbd>* 21 * <var>extension</var> #</kbd>". You're not meant to type in "*21*extension#" literally; the "extension" bit is meant to be replaced with the actual extension to which you want to redirect, like "*21*4572#".
It's a common misunderstanding, but I was disappointed to see it in this series, which has been of very high quality up to here.
No, <var> is meant for marking up variable parts of an expression, usually an example. It's a placeholder; something that shows that a real value should be substituted when used in a concrete situation.
Like when you're explaining how employees' email addresses are made up: <var>firstName</var>.<var>lastName</var>@example.com.
Or like this, "redirect your telephone by pressing <kbd>* 21 * <var>extension</var> #</kbd>". You're not meant to type in "*21*extension#" literally; the "extension" bit is meant to be replaced with the actual extension to which you want to redirect, like "*21*4572#".
It's a common misunderstanding, but I was disappointed to see it in this series, which has been of very high quality up to here.
Tommy Olsson
Thanks for the feedback guys - we'll explore your points, and make corrections to the article as necessary.
Chris Mills
Developer Relations Manager
Editor, dev.opera.com and labs.opera.com
Developer Relations Manager
Editor, dev.opera.com and labs.opera.com
mnfrancis,
this article inspired me big time. after reading this article i modified how my voice web site app speaks its articles. I was using ids and the vxml:prompt tag. Now i'm using javascript to extract text from the article html code and modifying the text. The home page at my site is a good example with abbreviations and acronyms and the source code shows how its done.
thanks for the inspiration
joe budd http://voice.codebyjoe.com/
this article inspired me big time. after reading this article i modified how my voice web site app speaks its articles. I was using ids and the vxml:prompt tag. Now i'm using javascript to extract text from the article html code and modifying the text. The home page at my site is a good example with abbreviations and acronyms and the source code shows how its done.
thanks for the inspiration
joe budd http://voice.codebyjoe.com/
Just wanted to point out the inaccuracy of the difference between an abbreviation and an acronym. Yes, an acronym is a form of abbreviation, but it has nothing to do with how the abbreviation will be pronounced. An acronym is merely an abbreviation consisting of the initial (or sometimes more) letters of words in the phrase. Therefore, both HTML and CSS are acronyms.
SansGravitas,
You make an excellent point and thank you.
Here is what i was taught in school.
http://searchcio-midmarket.techtarget.com/sDefinition/0,,sid183_gci211518,00.html
I honestly don't know what is correct anymore.
You make an excellent point and thank you.
Here is what i was taught in school.
http://searchcio-midmarket.techtarget.com/sDefinition/0,,sid183_gci211518,00.html
I honestly don't know what is correct anymore.
Originally posted by SansGravitas:
Just wanted to point out the inaccuracy of the difference between an abbreviation and an acronym.
I agree - you are right. Do you think any wording needs ot be changed in the article?
Chris Mills
Developer Relations Manager
Editor, dev.opera.com and labs.opera.com
Developer Relations Manager
Editor, dev.opera.com and labs.opera.com
Originally posted by greut:
Why taking the /wrong/ example of
to demonstrate the usage? It's confusing.
Can you explain in a bit more detail why you think this is confusing? The article shows two correct uses of the <address> element, and then an incorrect usage of it, which is clearly stated to be incorrect. I'm not saying you're wrong - you could be interpreting something I'm not seeing - but I don't see why this is confusing.
Chris Mills
Developer Relations Manager
Editor, dev.opera.com and labs.opera.com
Developer Relations Manager
Editor, dev.opera.com and labs.opera.com