HTML Tag <CODE>

HTML Tag <CODE>

<CODE> Embeds excerpts of program source code into your document text. This is useful if you want to show program source code inline within a paragraph of normal text. For showing formatted segments of source code longer than one line, use the <PRE> tag.

Attribute of <CODE> Tag

CLASS

Indicates which style class applies to the <CODE> element.

<CODE CLASS="casual">x++;</CODE>

Possible Values

Class Name.



ID

Assigns a unique ID selector to an instance of the <CODE> tag. When you then assign a style to that ID selector, it affects only that one instance of the <CODE> tag.

<CODE ID="123">while(x) x-;</CODE>

Possible Values

ID Name.



STYLE

Specifies Style Sheet commands that apply to the contents within the <CODE> tags.

<BODY STYLE="background: red">

Possible Values

CSS Property with value.



TITLE

Specifies text assigned to the tag. You might use this attribute for context-sensitive help within the document. Browsers may use this to show tool tips over the code text.

<CODE TITLE="C Code">exit(1);</CODE>

Possible Values

Any Text Message.




CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad