• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

XHTML Element für Code

byspeed

Neues Mitglied
Gibt es ein XHTML Element, das spezielle für Code definiert ist?
bspw.:
Folgender Code wird benötigt:
<code>mein code</code>

Denn <code> ist ja deprecated.
 
Ich habe gerade mal in die Specification zu HTML 5 gesehen, dort heißt es:



The following example shows how the element can be used in a paragraph to mark up element names and computer code, including punctuation.

Code:
<p>The <code>code</code> element represents a fragment of computer
code.</p>

<p>When you call the <code>activate()</code> method on the
<code>robotSnowman</code> object, the eyes glow.</p>

<p>The example below uses the <code>begin</code> keyword to indicate
the start of a statement block. It is paired with an <code>end</code>
keyword, which is followed by the <code>.</code> punctuation character
(full stop) to indicate the end of the program.</p>

The following example shows how a block of code could be marked up using the pre and code elements.

Code:
<pre><code class="language-pascal">var i: Integer;
begin
   i := 1;
end.</code></pre>

HTML5

Wie kommst du darauf, dass das Element deprecated ist?
 
das hatte ich auf irgendso einer seite gelesen, aber wenn es nun aus sicherer quelle ist, wird es wohl stimmen danke
 
Zurück
Oben