Syntaxhighlighter method _ javascript skills

Source: Internet
Author: User
Syntaxhighlighter usage Placing the code

Place your code on the page and surround it

 tag. Set name attribute to code and class attribute to one of the language aliases you wish to use. 

... some code here ...

NOTE: One important thing to watch out for is opening triangular bracket <. It must be replaced with an HTML equivalent of < in all cases. Failure to do won't break the page, but might break the source code displayed.

An alternative to

 is to use </TT> tag. There are no problems with <TT><</TT> character in that case. The main problem is that it doesn't look as good as <TT><pre></TT> tag if for some reason JavaScript didn't work (in RSS feed for example). </P><PRE class=code style="PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; MARGIN-LEFT: 2em; BORDER-LEFT: #ccc 3px solid; PADDING-TOP: 0.5em"><textarea name="code" class="c#" cols="60" rows="10">... some code here ...
Extended configuration

There's a way to pass a few configuration options to the code block. It's done via colon separated arguments.

... some code here ...
Making it work

Finally, to get the whole thing to render properly on the page, you have to add JavaScript to the page.

   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.