Inserting Source Code into a Blog Page

To list "source code" into a blog page, insert the following HTML codes:

<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: courier; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;">
<code style="color: black; overflow-wrap: normal; word-wrap: normal;"> 
PLACEHOLDER
</code></pre>


For example, the following is a simple "Hello World" program in the C language.
#include <stdio.h>
main(void) {
    printf("Hello World!\n");
}

Take Note

  • Replace character "less than" ( < ) with "&lt;"

No comments:

Post a Comment

Popular Posts

Blog Archive

About Me

My photo
Pamulang, Banten, Indonesia
(c) 2021 BinKadal. Powered by Blogger.