Click here to Skip to main content
11,923,958 members (68,017 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


16 bookmarked

Formatting code in Tips and Tricks

, 8 Apr 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
Syntax Coloring For Tip/Trick
Code in Tip/Trick Posts should wrapped with <pre> </pre> tags to ensure formatting and colouring are correct.


For example:


<pre lang = "vb">
' Example  
Dim test As String
will produce:

' Example
Dim test As String

To specify the programming language, use lang="xxx" as follows:


<pre lang = "C++"> for Native C++ Formatting
<pre lang = "mc++"> for C++/CLI Formatting
<pre lang = "aspnet"> for ASP.NET Formatting
<pre lang = "cs"> forC# Formatting
<pre lang = "css"> for CSS Formatting
<pre lang = "F#"> for F# Formatting
<pre lang = "html"> for HTML Formatting
<pre lang = "Java"> for Java Formatting
<pre lang = "jscript"> for JavaScript Formatting
<pre lang = "asm"> for MASM/ASM Formatting
<pre lang = "msil"> for MSIL Formatting
<pre lang = "midl"> for MIDL Formatting
<pre lang = "php"> for PHP Formatting
<pre lang = "sql"> for SQL Formatting
<pre lang = "vbscript"> for VBScript Formatting
<pre lang = "xml"> for XML Formatting
If you want to enter text like <pre lang = "xml">,

  1. Check the allow HTML radio button in the Tip/Trick editor "When Pasting" option list. Use the article editor to enter text. Copy its HTML and paste here.

  2. Learn the special text for symbols like <(&-lt-; Remove the - for the symbol)


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Anshul R
India India
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralFDG Pin
Pawan Pandey (P.P)31-Oct-13 8:38
professionalPawan Pandey (P.P)31-Oct-13 8:38 
QuestionThis is not working Pin
muhtarqong11-Feb-13 9:28
membermuhtarqong11-Feb-13 9:28 
This is not working. Are there some settings?
GeneralReason for my vote 5 Pin
D-Kishore3-Sep-12 20:56
memberD-Kishore3-Sep-12 20:56 
GeneralReason for my vote of 5 very helpful while we post some tips... Pin
nikhi _singh15-Feb-12 1:03
membernikhi _singh15-Feb-12 1:03 
Generalwhen & where can i edit a question submitted by someone else... Pin
anushripatil10-Jan-12 19:20
memberanushripatil10-Jan-12 19:20 
GeneralReason for my vote of 5 Thx Pin
Pranit Kothari3-Jan-12 16:22
memberPranit Kothari3-Jan-12 16:22 
GeneralReason for my vote of 5 usefull one Pin
RupeshKumar26-Sep-11 6:23
memberRupeshKumar26-Sep-11 6:23 
GeneralReason for my vote of 1 feeeeeeee Pin
aaditya bhargava bansi17-Jul-11 4:00
memberaaditya bhargava bansi17-Jul-11 4:00 
GeneralReason for my vote of 5 Really useful!! Pin
Wong Shao Voon10-Feb-11 23:50
memberWong Shao Voon10-Feb-11 23:50 
GeneralReason for my vote of 5 Good one Pin
Eswa11-Dec-10 5:05
memberEswa11-Dec-10 5:05 
GeneralTwo things: this information is already included in the arti... Pin
knockNrod14-Sep-10 7:18
memberknockNrod14-Sep-10 7:18 
GeneralOne problem... Pin
Steve Wellens4-Sep-10 14:33
memberSteve Wellens4-Sep-10 14:33 
GeneralRe: One problem... Pin
Steve Wellens28-Nov-10 4:47
memberSteve Wellens28-Nov-10 4:47 
GeneralRe: One problem... Pin
pranav9529-Nov-10 1:26
memberpranav9529-Nov-10 1:26 
SuggestionRe: One problem... Pin
Shahan Ayyub24-Mar-13 6:03
memberShahan Ayyub24-Mar-13 6:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151125.3 | Last Updated 9 Apr 2013
Article Copyright 2010 by Anshul R
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid