How to add a nice code block to blogger

While there are awesome syntax highlighting and styling libraries  with nicely written tutorials for using them with blogger, a simple 'code' tag can suffice at times...

For such times:

.myCodeHighlighter {
    border-left: 4px solid #FF9933;
    display: block;
    font-family: Courier,"Courier New",monospace;
    margin: 15px;
    overflow: auto;
    padding: 15px;
    text-align: left;
    white-space: nowrap;
}


And use as:

<code class="myCodeHighlighter">
//the code codes here..
</code>


A preview of how it will make your code tags look like? You are looking right at it! :)

No comments:

Post a Comment

We need to talk, says one microservice to another

‘But how?’ asks the other service! Ever wondered how we communicate? One would not believe how complex and multi-step process it is. It in...