TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

HTML

HTML Images

Overview

HTML Images are defined with the <img> tag. To display an image on the web page, we need to use the src attribute. Src stands for “source”.

Syntax

src is an attribute that specifies the location of the image. The value of the src attribute is the URL of the image you want to display.

<img src=”path_to_the_image”/>

For example, if we have an image named “SampleImage.jpeg” under the images directory, then the image tag that will add the image to the web page would look like this:

<img src=”images/SampleImage.jpeg”/>

To display width and height of the image in pixels(px). For example, to specify the image of the width and height of 250px:

<img src=”SampleImage.jpeg” width=250 height=250 />

Example

We will use the img tag to display a sample placeholder image.

<html>
<!–
####################################
# HTML Image Display Demo
####################################
–>
<head>
<title> HTML Tutorials – HTML Image Tag Demo</title>
</head>

<body>
<h1> Image </h1>

<p>
We can also specify the width and height image:
<br>
<img src=”SampleImage.jpeg” width=250 height=250 />
</p>
</body>
</html>

 

Sample HTML Image

Display Link and Image Example

We also add a link to the image:

<a href=”target_URL” target=”_blank”>
<img src=”images/image_to_be_displayed.jpg”/>

 

—

HTML Tutorials

HTML Tutorials on this website:

https://www.testingdocs.com/html-tutorials/

More Information on HTML:

https://www.w3.org/TR/html401/intro/intro.html

Related Posts

Create HTML File

HTML /

Create HTML file with NetBeans IDE

HTML /

HTML5 Document Structure

HTML /

Introduction To HTML5

HTML5 Application NetBeans

HTML /

Create an HTML5 Application using NetBeans IDE

CSS Validator Tool

HTML /

HTML & CSS Validator Tools

‹ HTML Hyperlinks› HTML Tables

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version