If you post code to your blog or website, you might want to consider using the <code> element to help separate your content from the code. This can be achieved nicely by setting the style for the <code> element in your CSS. I use the following style in my blog to help format code snips that I post.
code
{
background-color: #f6ffff;
border: solid 2px #bbbbbb;
display: block;
font: courier;
margin-left: -10px;
overflow: auto;
white-space: pre;
width: 410px;
}
Sample:
<code>
#include <stdio.h>
int main(void)
{
printf("Hello world!\n");
return 0;
}
</code>
No comments:
Post a Comment