Html Course

HTML 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: PNG, BMP, TIFF, PCX

Adding image in HTML page

To add an image in a HTML document you can use the <img> tag and 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:
<h4>Example adding image</h4>

<img src='../imgs/smile_gift.png' alt='smile' width='150' height='132'>
- In the <img> tag you can add the style attribute with CSS properties to set the border, position and margins for image.
Example::
<h4>Example image and style</h4>

<img src='../imgs/smile_gift.png' alt='smile' width='150' height='132' style='border:2px solid #0000ee; margin:5px 25px;'>

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag defines the clickable areas inside the image map?
<map> <img> <area>
<img src="image.jpg" usemap="#map1">
<map name="map1">
  <area shape="rect" coords="9, 120, 56, 149" href="#">
  <area shape="rect" coords="100, 200, 156, 249" href="#">
</map>
Which CSS property defines what is done if the content in a box is too big for its defined space?
display overflow position
#id {
  overflow: auto;
}
Click on the event which is triggered when the mouse is positioned over an object.
onclick onmouseover onmouseout
document.getElementById("id").onmouseover = function(){
  document.write("Have Good Life");
}
Indicate the PHP variable that contains data added in URL address after the "?" character.
$_SESSION $_GET $_POST
if(isset($_GET["id"])) {
  echo $_GET["id"];
}
Adding images in page

Last accessed pages

  1. PHP Unzipper - Extract Zip, Rar Archives (31611)
  2. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (137118)
  3. Merge Multiple Files, Line by Line (1070)
  4. Select the Content of HTML Element (4444)
  5. Zodiac Signs JavaScript code (10965)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (316)
  2. PHP Unzipper - Extract Zip, Rar Archives (108)
  3. Read Excel file data in PHP - PhpExcelReader (100)
  4. SHA1 Encrypt data in JavaScript (81)
  5. Get and Modify content of an Iframe (73)
Chat
Chat or leave a message for the other users
Full screenInchide