AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL
HTML Tutorial

HTML image

Images are very important to design as well as to describe many complex concepts on your web page.
This tutorial will guide you through simple steps to use images in your website as: size, link and background.
Images can improve the design and the appearance of a web page.

HTML image inserted into web page.


You can insert any image in your website by using <img> tag. The simple syntax to use this tag for inserting images <img src="url">
Example 1:
<!DOCTYPE html>
<html>
<head>
<title>Insert image into webpage</title>
</head>
<body>
<p>This is a simple image inserted into web page </p>
<img src = "/images/test.jpg" alt = "Image test" />
</body>
</html>
Note: HTML image alt attribute. The value of the alt attribute from above example 1 should describe the image what it looks like.

Image Size - Width and Height

You can use the style attribute to specify the width and height of any image. Width and height of an image size can be specified in pixels or percentage.
Example2:
<!DOCTYPE html>
<html>
<head>
<title>Set up Image Width and Height for web page</title>
</head>
<body>
<p>We are setting up image width and height</p>
<img src = "/images/test.png" alt = "describes the image content" width = "260" height = "130"/>
</body>
</html>

Image as a Link.
To use an image as a link, you must put the <img> tag inside the <a> tag without border as example 3.
Example 3
<!DOCTYPE html>
<html>
<head>
<title>Set up Image Width and Height for web page</title>
</head>
<body>
<p>We are setting up image width and height</p>
<a href="default.html">
  <img src="smiley.jpg" alt="HTML tutorial" style="width:180px;height:120px;border:0;">
</a>
</body>
</html>
Example 4
- image with border 2px. By default, image will have a border around it. A thickness of 0 means, no border around the picture.
<!DOCTYPE html>
<html>
<head>
<title>Set up Image Width and Height for web page</title>
</head>
<body>
<p>We are setting up image width and height</p>
<a href="default.html">
  <img src="smiley.jpg" alt="HTML tutorial" style="width:180px;height:120px;border:2px;">
</a>
</body>
</html>

HTML image background

The background attribute indicate a background image for an item.
HTML - CSS syntax: <body style="background-image:url(htmltutorial.jpg)">
Syntax <body background="URL">
Example 5:
<!DOCTYPE html>
<html>
<head>
<title>Set up Image Width and Height for web page</title>
</head>
<body background="niceimage.jpg">
<p>We are setting up image width and height</p>
<a href="default.html">
  <img src="smiley.jpg" alt="HTML tutorial" style="width:180px;height:120px;border:0;">
</a>
</body>
</html>
NOTE: The <body> background attribute is not supported in HTML5. Better way use CSS instead


HTML image, html image size, image link, image background
HTML image, size, link and image background - html tutorial

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


HTML Img Background
HTML Image Link
HTML Image Size
HTML Text Style
HTML Text Align
HTML Text Size
HTML Text Color Style
HTML Text Color
HTML Table Color
HTML Table Row Colspan
HTML Table Width
HTML Table Style
HTML Table Border
HTML Table
HTML Font Face
HTML Font Size
HTML Font Color
HTML Headings
HTML div border color
HTML div class
HTML class container
HTML form action
HTML comment
HTML link new tab
HTML link underline
HTML link tag
HTML button action
HTML button onclick
HTML button link
HTML table style
HTML image
HTML colors
HTML div style
Text, paragraf in HTML
HTML Tags Attributes
HTML - Elements
HTML Introduction
Home HTML Tutorial
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.