หน้าเว็บ

วันจันทร์ที่ 12 มกราคม พ.ศ. 2558

วิธีโพส source code บน google blogspot

วิธีโพส source code บน google blogspot 1. หลังจาก sign in แล้วให้คลิ๊กเลือก Design บนแถบควบคุม จากนั้นเลือก Edit HTML 2. ที่แถบ Edit Template ให้ copy โค้ดด้านล่างนี้ไปวางไว้ก่อนหน้าแทก </head>

<link href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css" rel="stylesheet" type="text/css"/>
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js" type="text/javascript"/>
3. สุดท้ายให้เพิ่มโค้ดเข้าไปที่ body จะได้ว่า
<body onload='prettyPrint()'>
4. ถึงจุดนี้เราก็จะสามารถแสดง source code โดยใช้ pre แทกซึ่งเรียกใช้ผ่านคลาส prettyprint ดังตัวอย่างตามโค้ดด้านล่าง
<pre class="prettyprint">
source code
</pre>
ที่มา : http://stongphu.blogspot.com

ไม่มีความคิดเห็น:

แสดงความคิดเห็น