SlideShare a Scribd company logo
2
Most read
4
Most read
14
Most read
HTML Images Syntax
BY.: TR. MJ FERNANDEZ
JOY IN LEARNING SCHOOL INC.
HTML Images Syntax
 In HTML, images are defined with the <img> tag.
 The <img> tag is empty, it contains attributes only, and
does not have a closing tag.
 The src attribute specifies the URL (web address) of the
image:
The alt Attribute
 The alt attribute provides an alternate text for an image, if
the user for some reason cannot view it (because of slow
connection, an error in the src attribute, or if the user uses a
screen reader).
 The value of the alt attribute should describe the image:
The alt Attribute If a browser cannot find an image, it will
display the value of the alt attribute:
The alt Attribute If a browser cannot find an image, it will
display the value of the alt attribute:
Image Size - Width and Height
Image Size - Width and Height
Alternatively, you can use
the width and height attribute
s:
Alternatively, you can use
the width and height attributes:
The width and height attributes always
defines the width and height of the image in
pixels.
Width and Height, or Style?
The width, height, and style attributes are valid in HTML.
However, we suggest using the style attribute. It prevents styles sheets from changing the
size of images:
Width and Height, or Style?
The width, height, and style attributes are valid in HTML.
However, we suggest using the style attribute. It prevents styles sheets from changing the
size of images:
Images in Another Folder
If not specified, the browser expects to find the image in the same folder as the web page.
However, it is common to store images in a sub-folder. You must then include the folder
name in the src attribute:
Images on Another Server
Some web sites store their images on image servers.
Actually, you can access images from any web address in the world:
Animated Images
HTML allows animated GIFs:
Image as a Link
To use an image as a link, put the <img> tag inside the <a> tag:
Image Floating
Use the CSS float property to let the image float to the right or to the left of a
text:
Image Floating
Use the CSS float property to let the image float to the right or to the left of a
text:
Image Maps
The <map> tag defines an image-map. An image-map is an image with clickable areas.
In the image below, click on the computer, the phone, or the cup of coffee:
The name attribute of
the <map> tag is
associated with
the <img>'s usemap
attribute and creates a
relationship between the
image and the map.
The <map> element
contains a number
of <area> tags, that
define the clickable
areas in the image-map.
Image Maps
Background Image
To add a background image on an HTML element, use the CSS property background-image:
The HTML <picture> Element
HTML5 introduced the <picture> element to add more flexibility when specifying
image resources.
The <picture> element contains a number of <source> elements, each referring
to different image sources. This way the browser can choose the image that
best fits the current view and/or device.
Each <source> element have attributes describing when their image is the most
suitable.
The browser will use the first <source> element with matching attribute values,
and ignore any following <source> elements.
The HTML <picture> Element
Html images syntax
Chapter Summary
•Use the HTML <img> element to define an image
•Use the HTML src attribute to define the URL of the image
•Use the HTML alt attribute to define an alternate text for an image, if it cannot be
displayed
•Use the HTML width and height attributes to define the size of the image
•Use the CSS width and height properties to define the size of the image
(alternatively)
•Use the CSS float property to let the image float
•Use the HTML <map> element to define an image-map
•Use the HTML <area> element to define the clickable areas in the image-map
•Use the HTML <img>'s element usemap attribute to point to an image-map
•Use the HTML <picture> element to show different images for different devices
REFERENCE:
HTML IMAGES
https://www.w3schools.com/html/html_images.asp

More Related Content

PPT
2. html attributes
PPTX
HTML5 - Insert images and Apply page backgrounds
PPTX
Images and Tables in HTML
PPT
Hyperlinks in HTML
PPTX
HTML frames and HTML forms
PPTX
Html links
PPT
Intro Html
2. html attributes
HTML5 - Insert images and Apply page backgrounds
Images and Tables in HTML
Hyperlinks in HTML
HTML frames and HTML forms
Html links
Intro Html

What's hot (20)

PPTX
html-table
PPTX
Anchor tag HTML Presentation
PDF
Html table tags
PDF
Html frames
PPTX
Cascading style sheets (CSS)
PDF
HTML PPT.pdf
PPT
Introduction to Cascading Style Sheets (CSS)
PPTX
Html coding
PPTX
Html ppt
PPTX
Links in Html
PPT
HTML Tags
PPTX
Html form tag
PPTX
Html images
PDF
Introduction to HTML5
PPTX
PPT
Introduction to CSS
PDF
Div tag presentation
PPTX
Css Complete Notes
PPTX
html-table
Anchor tag HTML Presentation
Html table tags
Html frames
Cascading style sheets (CSS)
HTML PPT.pdf
Introduction to Cascading Style Sheets (CSS)
Html coding
Html ppt
Links in Html
HTML Tags
Html form tag
Html images
Introduction to HTML5
Introduction to CSS
Div tag presentation
Css Complete Notes
Ad

Similar to Html images syntax (20)

PPTX
HTML Images
PPTX
Html images and html backgrounds
PPTX
HTML Attributes.pptx
PPTX
CHAPTER 2_ Get Started with HTML Module
PPTX
Std 10 Computer Chapter 3 Handling Images in HTML (Part 1)
PDF
Chapter 2.pdf
PPT
lecture4.ppt
PPTX
PPTX
HTML Basics
PDF
HTML FOR BEGINNERS AND FOR PRACTICE .pdf
PPTX
HTML-Basic.pptx
PPT
HTML_Images.ppt
PDF
Web Development 3 (HTML & CSS)
PPTX
Full Stack_HTML- Hypertext Markup Language
PPSX
Steph's Html5 and css presentation
PPT
Web forms and html lecture Number 2
PPSX
Steph's Html5 and css presentation
PPTX
Designing web page marquee and img tag
PPTX
AttributesL3.pptx
PPTX
More on HTML Communication Skills BASICS
HTML Images
Html images and html backgrounds
HTML Attributes.pptx
CHAPTER 2_ Get Started with HTML Module
Std 10 Computer Chapter 3 Handling Images in HTML (Part 1)
Chapter 2.pdf
lecture4.ppt
HTML Basics
HTML FOR BEGINNERS AND FOR PRACTICE .pdf
HTML-Basic.pptx
HTML_Images.ppt
Web Development 3 (HTML & CSS)
Full Stack_HTML- Hypertext Markup Language
Steph's Html5 and css presentation
Web forms and html lecture Number 2
Steph's Html5 and css presentation
Designing web page marquee and img tag
AttributesL3.pptx
More on HTML Communication Skills BASICS
Ad

More from JayjZens (20)

PPTX
LESSON 9 (WEEK 10) COLLABORATIVE ICT DEVELOPMENT.pptx
PPTX
LESSON 8 (WEEK 9) BASIC WEB PAGE CREATION.pptx
PPTX
LESSON 7 (WEEK 8) ONLINE PLATFORMS FOR ICT CONTENT DEVELOPMENT.pptx
PPTX
LESSON 4 (WEEK 5) PRODUCTIVITY TOOL (MS EXCEL).pptx
PPTX
LESSON 1 (WEEK 1) INFORMATION AND COMMUNICATION TECHNOLOGY_2.pptx
PDF
ETECH_Chapter 1_Module_2022-2023.pdf
PPTX
Science 7 lesson 1.1
PPTX
Quilling famtime
PPTX
Rebekah women of the bible
PPTX
1. intro ict
PPTX
Evaluating internet resources
PPTX
Web browser &amp; search engine
PPTX
Introbotics
PPTX
Creating &amp; organizing bookmark for website
PPTX
Advantages and disadvantages of using online tools
PPT
1. introduction to html5
PPTX
Styling of css
PPTX
Html table
PPTX
Creating you first web page!
PPTX
Roborobo 3 parts
LESSON 9 (WEEK 10) COLLABORATIVE ICT DEVELOPMENT.pptx
LESSON 8 (WEEK 9) BASIC WEB PAGE CREATION.pptx
LESSON 7 (WEEK 8) ONLINE PLATFORMS FOR ICT CONTENT DEVELOPMENT.pptx
LESSON 4 (WEEK 5) PRODUCTIVITY TOOL (MS EXCEL).pptx
LESSON 1 (WEEK 1) INFORMATION AND COMMUNICATION TECHNOLOGY_2.pptx
ETECH_Chapter 1_Module_2022-2023.pdf
Science 7 lesson 1.1
Quilling famtime
Rebekah women of the bible
1. intro ict
Evaluating internet resources
Web browser &amp; search engine
Introbotics
Creating &amp; organizing bookmark for website
Advantages and disadvantages of using online tools
1. introduction to html5
Styling of css
Html table
Creating you first web page!
Roborobo 3 parts

Recently uploaded (20)

PDF
Nekopoi APK 2025 free lastest update
PPTX
ai tools demonstartion for schools and inter college
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
medical staffing services at VALiNTRY
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
L1 - Introduction to python Backend.pptx
PDF
top salesforce developer skills in 2025.pdf
PDF
AI in Product Development-omnex systems
PPTX
Transform Your Business with a Software ERP System
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
history of c programming in notes for students .pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPT
Introduction Database Management System for Course Database
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Nekopoi APK 2025 free lastest update
ai tools demonstartion for schools and inter college
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
medical staffing services at VALiNTRY
Internet Downloader Manager (IDM) Crack 6.42 Build 41
L1 - Introduction to python Backend.pptx
top salesforce developer skills in 2025.pdf
AI in Product Development-omnex systems
Transform Your Business with a Software ERP System
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Navsoft: AI-Powered Business Solutions & Custom Software Development
ManageIQ - Sprint 268 Review - Slide Deck
Understanding Forklifts - TECH EHS Solution
history of c programming in notes for students .pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
2025 Textile ERP Trends: SAP, Odoo & Oracle
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Introduction Database Management System for Course Database
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...

Html images syntax

  • 1. HTML Images Syntax BY.: TR. MJ FERNANDEZ JOY IN LEARNING SCHOOL INC.
  • 2. HTML Images Syntax  In HTML, images are defined with the <img> tag.  The <img> tag is empty, it contains attributes only, and does not have a closing tag.  The src attribute specifies the URL (web address) of the image:
  • 3. The alt Attribute  The alt attribute provides an alternate text for an image, if the user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader).  The value of the alt attribute should describe the image:
  • 4. The alt Attribute If a browser cannot find an image, it will display the value of the alt attribute:
  • 5. The alt Attribute If a browser cannot find an image, it will display the value of the alt attribute:
  • 6. Image Size - Width and Height
  • 7. Image Size - Width and Height Alternatively, you can use the width and height attribute s:
  • 8. Alternatively, you can use the width and height attributes: The width and height attributes always defines the width and height of the image in pixels.
  • 9. Width and Height, or Style? The width, height, and style attributes are valid in HTML. However, we suggest using the style attribute. It prevents styles sheets from changing the size of images:
  • 10. Width and Height, or Style? The width, height, and style attributes are valid in HTML. However, we suggest using the style attribute. It prevents styles sheets from changing the size of images:
  • 11. Images in Another Folder If not specified, the browser expects to find the image in the same folder as the web page. However, it is common to store images in a sub-folder. You must then include the folder name in the src attribute:
  • 12. Images on Another Server Some web sites store their images on image servers. Actually, you can access images from any web address in the world:
  • 13. Animated Images HTML allows animated GIFs:
  • 14. Image as a Link To use an image as a link, put the <img> tag inside the <a> tag:
  • 15. Image Floating Use the CSS float property to let the image float to the right or to the left of a text:
  • 16. Image Floating Use the CSS float property to let the image float to the right or to the left of a text:
  • 17. Image Maps The <map> tag defines an image-map. An image-map is an image with clickable areas. In the image below, click on the computer, the phone, or the cup of coffee: The name attribute of the <map> tag is associated with the <img>'s usemap attribute and creates a relationship between the image and the map. The <map> element contains a number of <area> tags, that define the clickable areas in the image-map.
  • 19. Background Image To add a background image on an HTML element, use the CSS property background-image:
  • 20. The HTML <picture> Element HTML5 introduced the <picture> element to add more flexibility when specifying image resources. The <picture> element contains a number of <source> elements, each referring to different image sources. This way the browser can choose the image that best fits the current view and/or device. Each <source> element have attributes describing when their image is the most suitable. The browser will use the first <source> element with matching attribute values, and ignore any following <source> elements.
  • 23. Chapter Summary •Use the HTML <img> element to define an image •Use the HTML src attribute to define the URL of the image •Use the HTML alt attribute to define an alternate text for an image, if it cannot be displayed •Use the HTML width and height attributes to define the size of the image •Use the CSS width and height properties to define the size of the image (alternatively) •Use the CSS float property to let the image float •Use the HTML <map> element to define an image-map •Use the HTML <area> element to define the clickable areas in the image-map •Use the HTML <img>'s element usemap attribute to point to an image-map •Use the HTML <picture> element to show different images for different devices