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

    • ChatGPT Plans Free and PlusChatGPT Subscription Plans
    • Stellar Converter for Database ToolStellar Converter for Database
    • Stellar MySQL Log AnalyzerStellar Log Analyzer for MySQL
    • Stellar Repair for MySQLStellar Repair for MySQL
    • ChatGPT IntroductionChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI FeaturesChatGPT4 Conversational AI Features
    • Trends in Software EngineeringShaping the Future of Development: Exploring Key Trends in Software Engineering
    • Java PerformanceImproving Java Performance with Multithreading
    • QDrant Vector DatabaseOpen-source Vector Databases
    • Difference between PHP and JavaScript?
    • Bing AI Browser Web ContentBing Conversation Styles
    • ChatGPT PreviewChatGPT Introduction
    • Open Source AI Frameworks TensorFlowOpen Source AI Frameworks
    • Artificial Intelligence Tools

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com