HTML also contains elements for adding images to your website.
The formats most used for the images added in a HTML page are GIF and JPEG (JPG ; JPE), the advantage of GIF images is that are small in size (in bytes), having a maximum of 256 colors.
Other format types that can be used are:

Adding a image in a webpage

To add an image in a HTML document you must use the element <img> together with the following attributes:

In the following example you can see how you can include an image in your web page and how to use these attributes:
<html>
<head>
<title>The title</title>
</head>
<body>
<img src="image.jpg" alt="simple text" width="100" height="120">
</body>
</html>
- The web page will appear like this:
simple text

- In the <img> tag you can add the "style" attribute with CSS properties to set the border, position and margins for image.
Example:
<img src='adr_image.png' alt='text echivalent' width='200' height='100' style="border:2px solid #0000ee; margin:2px 5px;">

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add definition lists into a <dl> element?
<dt> <dd> <li>
<dl>
 <dt>HTML</dt>
  <dd> - Hyper Text Markup Language</dd>
  <dd> - Language for web pages</dd>
</dl>
Which CSS property can hide an element on page, letting an empty space in its place?
display position visibility
#id {
  visibility: hidden;
}
Click on the event which is triggered when the mouse clicks on an object.
onclick onmouseover onfocus
document.getElementById("id").onclick = function(){
  alert("http://CoursesWeb.net/");
}
Indicate the PHP variable that contains the contents of both $_GET, $_POST, and $_COOKIE arrays.
$_SESSION $_GET $_REQUEST
if(isset($_REQUEST["id"])) {
  echo $_REQUEST["id"];
}
Adding images in page

Last accessed pages

  1. PHP-MySQL Scripts (3745)
  2. PHP getElementById and getElementsByTagName (19140)
  3. Redirects (503)
  4. innerHTML and outerHTML to Get and Replace HTML content (17553)
  5. Add Pause in JavaScript script (9350)

Popular pages this month

  1. Read Excel file data in PHP - PhpExcelReader (443)
  2. PhpSpreadsheet - Read, Write Excel and LibreOffice Calc files (351)
  3. Register and show online users and visitors (319)
  4. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (300)
  5. Insert, Select and Update NULL value in MySQL (214)