Thursday, May 27, 2010

Making a programming Blog

First you need to set up what you want the site to look like. For code it is better to have blocks that are separated from the rest of the text
like this block here
This block can be created by using the following HTML/CSS code
<div style="border: 1px solid rgb(51, 51, 51); background-color: rgb(204, 204, 204); padding: 2px; margin: 5px 20px; color: rgb(0, 0, 0);"><tt>
code here
</tt></div>
The <tt> tag is used to make the text inside teletype making it look more like code. By changing the values inside style you can change how the box looks.

Next things are tabs, if you know anything about HTML, tabs and other white space are ignored so you cannot use tabs, what you can do is use div tags with left margins

so you can
do something like this
with multiple indented lines
To do this you use the code
<div style="margin-left: 25px;">
indented code here
</div>

The last thing you need to know is what do do if you are trying to display a tag like <tag> because HTML will think that it is a tag and not something that you want to display
<
>
&
 
"
®
©
&lt;
&gt;
&amp;
&nbsp;
&quot;
&reg;
&copy;
less than
greater than
ampersand
non breaking space
double quote
registered trade mark
copyright

No comments:

Post a Comment