User:Jimbojw/Semantically correct right-aligned edit link

From mediawiki.org

This article is a demonstration of how one might go about creating a "semantcially correct" XHTML markup but using "German style" edit links.

Explanation section

Some content - Lorem ipsum style!

The header for this section was built with a div (instead of the more correct 'h2' element) since the inner [edit] link was breaking the style - but the same logic applies. Also, all the style is currently inline, but could be moved out to CSS via classes.

The semantically correct HTML representation would look more like this:

<h2><span>Explanation section</span></h2>
<div class="editsection">[<a href="/edit/url">edit</a>]</div>

View the source of the page to see how the previous section was created (it's ugly due to all the inline style).

Notes
  • I have not tested this on anything other than Firefox 2 and Konqueror on Linux - however, I believe the principle is sound and could be used (in some form) on other browsers/platforms.
  • I have not tested the effect of extremely long titles that cause wrapping.