Below is a complete guide of HTML codes that you can copy and paste for use on your own blog or website.
Although I like to insist on bloggers taking the time to learn how to write these codes and know what each part of them does, sometimes you need a code in a pinch!
Be sure to view the other CSS tutorials on this site for more in-depth demonstrations and explanations of coding.
Defines an important heading in your text.
You can use <h1> to <h6>, with the highest number resulting in the smallest font size.
<h1>Your important heading</h1>
Aligns your heading using a little bit of CSS. You can use “left”, “right”, or “justify” in place of “center” below:
<h1 style="text-align:center;">Your aligned heading</h1>
Inserts a paragraph break. Defines each paragraph.
<p>Your paragraph here</p>
Aligns your paragraph using a little bit of CSS. You can use “left”, “right”, or “justify” in place of “center” below:
<p style="text-align:center">Your paragraph text is aligned</p>
Line breaks are used instead of paragraphs, when you want to create a new line without starting a new paragraph.
The end of your sentence.<br />
Makes the weight of your font bold
<b>Your bold text</b>
Same look as bold text, but is semantic. Instead of it being simply a style, strong text shows how the text should be read or understood.
<strong>Your strong text</strong>
Makes your text italicized
<i>Your italic text</i>
Same look as Italic text in HTML, but is semantic. Specifies that the text should be emphasized when read.
<em>Your emphasized text</em>
Underlines your text
<u>Your underlined text</u>
Places a line through your text to strike it out.
<s>Your text here</s>
Changes the font of the text using a little CSS. You can change the font to any web safe font or Google web font.
<span style="font-family: Arial, Helvetica, sans-serif;">Your new font</span>
Changes the size of the font using a little CSS. You can use px, em, or a percentage. Here is an example with px:
<span style="font-size:16px;">Your font in a new size</span>
Changes the color of your font to any hex color value of your choice:
<span style="font-color:#030303;">Your new font color</span>
Highlights the text with a background color using a little CSS:
<span style="background-color:#C2F2CA">Your highlighted text</span>
Useful when quoting someone or when you need a particular part of your text to stand out.
<blockquote>Your quoted text here</blockquote>
Use to add a link to specific text or a word. Replace the http://www.yourlink.com with your own link:
<a href="http://www.yourlink.com">Your linked text</a>
Used to open the link in a new window or tab instead of in the same web page:
<a href="http://www.yourlink.com" target="_blank">Your linked text</a>
Opens the user’s email program to quickly send an email to the address supplied. Replace the email address with your own:
<a href="mailto:you@youremailaddress.com">Your email address or link</a>
Useful if you want the email to have a specific subject when a user clicks your link. Use %20 in place of any spaces and replace the text with your own subject line:
<a href="mailto:you@youremailaddress.com?subject=Your-Email-Subject-;Your email address or link</a>
Anchor links, or “jump-to links“, are used for jumping to a particular part of a page with the click of a link.
This happens in two parts.
First, include the code below wherever you want the user to end up when they click the link, for example, at the top of the post.
Name it something unique:
<a name="backtotop"></a>
Then, add the anchor to your link that the user will click on to jump to that section:
<a href="#backtotop">Back to top</a>
Include an image in your post.
Replace the image URL with your own URL.
You will need to have this image uploaded somewhere online.
Describing your image helps with SEO:
For adding a link to a certain image.
Replace the image URL and link with your own:
<a href="http://www.yourlink.com">
<img src="http://www.yoursite.com/yourimage.jpg" alt="describe this image"/></a>
<a href="http://www.yourlink.com" target="_blank">
<img src="http://www.yoursite.com/yourimage.jpg" alt="describe this image"/></a>
You can change the width and height of the image if you need to, however it’s usually best to resize your image prior to adding it to your site.
You can specify the width and height below for browser compatibility.
Change the width and height values to those of your actual image:
<img src="http://www.yoursite.com/yourimage.jpg" alt="describe this image" width="450" height="600"/>
If you want to place your image to the left or right of a paragraph, use the following code, replacing “left” with “right” if you like:
<img src="http://www.yoursite.com/yourimage.jpg" alt="describe this image" align="left"/>
The following should be completed in your site’s main CSS file, or a dedicated CSS section of your website/blog editor.
If you don’t have a CSS section or file, you can place these codes in between <style> and </style> tags in the <head> section of your website’s HTML, although it is recommended to have an external CSS file.
Change the overall background of your website or blog with this code.
Replace the color hex code with your own.
body {background-color:#c3c3c3;}
For smaller backgrounds that you want tiled, or larger backgrounds that were made to be repeating, use this code and replace the image URL with your own.
You will need to upload the image online first:
body {background-image:url(http://www.yourwebsite.com/background-image.jpg);background-repeat:repeat;}
Change the above red “repeat” if you want the image to only repeat vertically: repeat-yChange the above red “repeat” if you want the image to only repeat horizontally: repeat-x
For background images that you want displayed only once (not repeated or tiled). Replace the image URL with your own.
body {background-image:url(http://www.yourwebsite.com/background-image.jpg);background-repeat:no-repeat;}
Center your background image on the page, at the top. Replace the image URL with your own.
body {background-image:url(http://www.yourwebsite.com/background-image.jpg);
background-repeat:no-repeat;background-position: top center;}
Center your background image on the page, at the top.
It will repeat vertically down the page.
Replace the image URL with your own.
body {background-image:url(http://www.yourwebsite.com/background-image.jpg);
background-repeat:repeat-y;background-position: top center;}
This will create a numbered list.
Replace list elements with your own:
<ol><li>List item 1</li><li>List item 2</li><li>List item 3</li></ol>
This will create a list with bullets instead of numbers. Replace list elements with your own:
<ul><li>List item 1</li><li>List item 2</li><li>List item 3</li></ul>
You can change the bullet type of any unordered list to circle, square, or disc (default):
<ul><li style="list-style-type:square">List item 1</li></ul>
If you want to use your own bullet image instead of the default ones, you can do that as well with a little CSS.
Perhaps a star or a heart or check mark? You will need to create a small enough image and upload it somewhere online:
<ul style="list-style-image:url('http://yourimageurl.com/yourbullet.jpg')">
<li>List item 1</li><li>List item 2</li><li>List item 3</li></ul>
Copyright symbol ©
©
Less Than Symbol <
<
Greater Than Symbol >
>
Ampersand &
&
Trademark Symbol ™
™
Non-breaking Space
Quotation Mark “
"
Registered Trademark ®
®
Heart ♥
♥
Euro sign €
€
Left Arrow ←
←
Right Arrow →
→
Up Arrow ↑
↑
Down Arrow ↓
↓
Spade ♠
♠
Club ♣
♣
Diamond ♦
♦
Discover our favorite blogging tools, resources, and examples to build and scale a successful blog.