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 meta tag provides a short description of the page?
<meta content="..."> <meta description="..."> <meta http-equiv="...">
<meta name="description" content="70-160 characters that describes the content of the page" />
Which CSS property is used to stop the wrapping effect of the "float"?
clear text-align position
#some_id {
  clear: both;
}
Click on the method which gets an array with all the elements in the document that have a specified tag name.
getElementsByName() getElementById() getElementsByTagName()
var divs = document.getElementsByTagName("div");
var nr_divs = divs.length;
alert(nr_divs);
Indicate the PHP function which returns the number of elements in array.
is_[) count() strlen()
$arr =[7, 8, "abc", 10);
$nri = count($arr);
echo $nri;        // 4
Adding images in page

Last accessed pages

  1. Properties and Methods of the Form elements (594)
  2. PHP Strings (3263)
  3. Selection Tools (8145)
  4. Get Lower, Higher, and Closest Number (5342)
  5. Simple Admin Login PHP Script (10894)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (201)
  2. Read Excel file data in PHP - PhpExcelReader (66)
  3. The Mastery of Love (56)
  4. PHP Unzipper - Extract Zip, Rar Archives (51)
  5. Working with MySQL Database (34)
Chat
Chat or leave a message for the other users
Full screenInchide