Dev.Opera - Follow the standards, break the rulesDev.Opera - Follow the standards, break the rules

Login

Lost password?

Forums » Article Discussions

Discuss the articles posted on Dev.Opera.

Note: You need to login to post in the forums. if you don't have an account you first need to sign up.

By mnfrancis anchor Tuesday, 8. July 2008, 07:16:49

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 )

By remysharp anchor Tuesday, 8. July 2008, 15:54:28

avatarThis 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?

By dorward anchor Tuesday, 8. July 2008, 16:05:40

avatar

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)

Post edited Tuesday, 8. July 2008, 16:16:38

By dorward anchor Tuesday, 8. July 2008, 16:19:05

avatar

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).

By AutisticCuckoo anchor Tuesday, 8. July 2008, 16:22:09

avatarI'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.

By zcorpan anchor Wednesday, 9. July 2008, 15:01:28

avatarIn two examples address is nested in p but that's not allowed in HTML. In the first example (the copyright footer) the address element should go and in the second (the br-in-address) the p element should go.

By chrismills O anchor Wednesday, 9. July 2008, 16:37:11

avatarThanks for the feedback guys - we'll explore your points, and make corrections to the article as necessary.

By codebyjoe anchor Saturday, 12. July 2008, 05:44:11

avatarmnfrancis,

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/

By SansGravitas anchor Wednesday, 17. September 2008, 00:12:02

avatarJust 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.

By codebyjoe anchor Wednesday, 17. September 2008, 00:30:37

avatarSansGravitas,

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.

By chrismills O anchor Friday, 19. September 2008, 16:23:19

avatar

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?

By greut anchor Tuesday, 23. September 2008, 12:54:04

avatarHi,

Why taking the /wrong/ example of <address> to demonstrate the
usage? It's confusing.

By chrismills O anchor Wednesday, 24. September 2008, 06:29:38

avatar

Originally posted by greut:

Why taking the /wrong/ example of <address> 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.

By stelt anchor Monday, 2. February 2009, 20:25:01

avatar"the address is contained within the footer paragraph".

I guess the code is changed, but the text isn't yet changed accordingly.

Moderators: pepelsbey | dstorey | mcx | operadev | chrismills | shwetankdixit | brucelawson | iheni | andreasbovens | zibin | mollydotcom