Image Codes

This page contains image codes. Feel free to copy and paste the image codes into your own website, blog, MySpace page, or other HTML document. And feel free to modify the code as you wish.

HTML and CSS provides many different image codes to add images to web pages.

This page explains the basic HTML image codes as well as the basic background image codes. There are also links to pages that provide more specific image-related code.

Basic HTML Image Code

To embed an image into a web page, you need to use the HTML img tag. This tag allows you to specify the location of your image, its dimensions, as well as other attributes.

Here's a code example of a basic image:

Source CodeResult
Cartoon drawing of city skyline

Background Images

You can create a background image so that other HTML elements appear in front of the image. To do this, you use the CSS background-image property.

Example:

Source CodeResult
This 'div' tag has a background image that repeats. See HTML background image for non-repeating background images.

More Image Codes

You can do a lot using HTML and CSS image codes. Below are some specific examples:

About the HTML Codes

The HTML code on this page is provided free of charge, for you to use however you wish. Feel free to modify the code to suit your own needs.

External Style Sheets

Most of the HTML codes on this website use inline CSS. If you intend to use the codes across your whole website, you should place the CSS into an external style sheet.

To learn more, check out this explanation of external style sheets.

Web Hosting

Our partner site, ZappyHost, is a professional web hosting company providing website hosting, domain names and related products. If you need web hosting, check them out!