ARTICLE

Show programming syntax using code tag

Posted by Valon Ademi Articles | Web Dev in VB.NET July 21, 2011
You can easily change the format of programming language using
Download Files:
 
Reader Level:

Code tag is used for indicating a source code of programming language. This code represent any variable name, type of variable, a filename, a computer program, or any type of code that computer would recognize. This tag is best used for short piece of code because it does not preserve white space.


Syntax

<cite

class=class names
id=specify unique id
style="style information >
 

</cite>

Attributes Introduced by HTML5
accesskey
contenteditable
contextmenu
data-X
draggable
hidden
itemid
itemprop
itemref
itemscope
itemtype
spellcheck
tabindex

HTML5 Event Attributes

onabort onblur oncanplay
oncanplaythrough onchange onclick
oncontextmenu ondblclick ondrag
ondragend ondragenter ondragleave
ondragover ondragstart ondrop
ondurationchange onemptied onended
onerror onfocus onformchange
onforminput oninput oninvalid
onkeydown onkeyup onload
onkeypress onloadeddata onloadedmetadata
onloadstart onmousedown onmousemove
onmouseout onmouseover onmouseup
onmousewheel onpause onplay
onplaying onprogress onratechange
onreadystatechange onscroll onseeked
onseeking onselect onshow
onstalled onsubmit onsuspend
ontimeupdate onvolumechange onwaiting

Code:

<!DOCTYPE html>
<
html>
<
head>
    <title></title>

</
head>
<
body>
    <p>
        In this line I am using  &lt;code&gt; tag. You should use <code>Server.MapPath()</code>
        to get virtual directory.</p>
    <p>
        In below line, I am not using &lt;code&gt; tag. To show the effect of code tag.<br />
        You should use Server.MapPath() to get virtual directory.</p>
    <code>
        <p>
            <code><strong>Programming language</strong></code></p>
    </code>
    <p>
        Code tag is used for indicating a source code of programming language. This code
        represent any variable name, type of variable, syntax of code, a filename, a computer
        program, or any type of code that computer would recognize. This tag is best used
        for short piece of code because it does not preserve white space.
    </p>
    <blockquote>
        <code><strong>Syntax:</strong></code>
        <br />
        <code>con.Open();<br />
            cmd.ExecuteNonQuery();<br />
            Response.Redirect("~/home.aspx"); </code>
    </blockquote>

</
body>
</
html>

Output

Internet Explore

code tag in HTML5

Chrome

code tag in HTML5

Safari

code tag in HTML5

Fire Fox

code tag in HTML5

Login to add your contents and source code to this article
share this article :
post comment
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor