SlideShare a Scribd company logo
Adding Images
XHTML <img> Element <img  src= &quot;mypic.jpg&quot;  alt= &quot;my text&quot;  /> Element Attribute Attribute Value Closing tag  Attribute Attribute Value The  src  attribute supplies the name and location of the image file you wish to display.  If no path is specified, the browser will expect the file to be in the same folder as the web page. The  alt  attribute determines what text will display in the web page if the image is not available.  This is also what screen readers (for the visually impaired) will use. Get in the habit of naming image files in all lowercase letters and use underscores or dashes instead of spaces.
<img> height and width attributes <img  src= &quot;sunset.jpg&quot;   height= &quot;600&quot;   width= &quot;800&quot;   alt= &quot;A beautiful sunset&quot;  /> By specifying the  height  and  width  attributes of an image, we help the browser display the image correctly on the page. We can use these attributes to make a large image appear smaller on the page.  We can also make a smaller image appear larger on the page, but this is not recommended, as the image will look pixelated and of poor quality. When making a large image appear smaller on the page, be sure to keep the same ratio of height to width.  If you don't, the resulting image will look &quot;squished&quot; when it displays on the page.
Determining the Height and Width: By viewing the properties of an image file in Windows, you can see what the width and height are.
Resizing the Height and Width: <img  src= &quot;sunset.jpg&quot;   height= &quot;300&quot;   width= &quot;400&quot;   alt= &quot;A beautiful sunset&quot;  /> By dividing the height and width evenly, we can resize an image on our web page.
Image Formats for the Web: The most common image formats for websites are (. jpg ), (. png ), and (. gif ) extensions.  While jpg files are used most often, the other two formats have their own advantages: Supports transparency: Supports animation: Color support: jpg png gif Excellent Excellent Limited       Best suited for: Image Extension: Photographs Logos, Icons Animations

More Related Content

PPTX
HTML Images
Nisa Soomro
 
PPTX
Html images and html backgrounds
nobel mujuji
 
PPTX
Images
Dustin Sanders
 
PPTX
Inserting imagesin html
nobel mujuji
 
PPT
Html 5 and CSS - Image Element
Kempy7000
 
PPTX
Std 10 Computer Chapter 3 Handling Images in HTML (Part 1)
Nuzhat Memon
 
PPTX
Mobilize Joomla
Kyle Ledbetter
 
PDF
oik-plugins: WordUp Pompey! Nov 2011
Herb Miller
 
HTML Images
Nisa Soomro
 
Html images and html backgrounds
nobel mujuji
 
Inserting imagesin html
nobel mujuji
 
Html 5 and CSS - Image Element
Kempy7000
 
Std 10 Computer Chapter 3 Handling Images in HTML (Part 1)
Nuzhat Memon
 
Mobilize Joomla
Kyle Ledbetter
 
oik-plugins: WordUp Pompey! Nov 2011
Herb Miller
 

Viewers also liked (20)

PPTX
Marathon Oil Corp. Industry Profile
LIS7205
 
PPTX
TPA-AL Wiki Explained
mendi2333
 
PPT
HES manā ciematā
Eva Vovka
 
PPTX
Shpogy secondary school
Eva Vovka
 
PPTX
[Gmic]nale be cubbying
Hyoin Sung
 
PPTX
Como sair das dividas de uma vez por todas
RafaelPSilva
 
PPT
Fstpt7 kanalisasi
a_agung_kartika
 
PDF
Pmk no. 1796 ttg registrasi tenaga kesehatan
Yulia Wibowo
 
PPT
6 kretska i mikenska umjetnost
atk2409
 
PDF
Erosion pdf
Matthew Smith
 
PPTX
Fashion than and_now
Eva Vovka
 
PPTX
Football (2)
Eva Vovka
 
PPS
LETRA E
galasol999
 
PPSX
Chachies del boske nuboso
kuckling2010
 
PPT
Idiom 1
daunchface25
 
PPTX
Kade karu ott 2
max97
 
PPTX
Another world (1)- Laura
Eva Vovka
 
PPTX
Tutoring and the research process
fishhead2
 
PPT
7.1 xhtml validation
Bulldogs83
 
PPTX
Samarbeidsoppgave gr5
EvaUnn39
 
Marathon Oil Corp. Industry Profile
LIS7205
 
TPA-AL Wiki Explained
mendi2333
 
HES manā ciematā
Eva Vovka
 
Shpogy secondary school
Eva Vovka
 
[Gmic]nale be cubbying
Hyoin Sung
 
Como sair das dividas de uma vez por todas
RafaelPSilva
 
Fstpt7 kanalisasi
a_agung_kartika
 
Pmk no. 1796 ttg registrasi tenaga kesehatan
Yulia Wibowo
 
6 kretska i mikenska umjetnost
atk2409
 
Erosion pdf
Matthew Smith
 
Fashion than and_now
Eva Vovka
 
Football (2)
Eva Vovka
 
LETRA E
galasol999
 
Chachies del boske nuboso
kuckling2010
 
Idiom 1
daunchface25
 
Kade karu ott 2
max97
 
Another world (1)- Laura
Eva Vovka
 
Tutoring and the research process
fishhead2
 
7.1 xhtml validation
Bulldogs83
 
Samarbeidsoppgave gr5
EvaUnn39
 
Ad

Similar to 2.1 adding images (20)

PPT
lecture4.ppt
ssuser08ea44
 
PPTX
Html images syntax
JayjZens
 
PPTX
HTML Attributes.pptx
Steins18
 
PPTX
Designing web page marquee and img tag
Jesus Obenita Jr.
 
PPTX
Html 5
pavishkumarsingh
 
PPTX
Presentation
Bbhulme1
 
PDF
Chapter 2.pdf
AnisZahirahAzman
 
PPTX
Project 03 Creating Web Pages with Links, Images, and Formatted Text
Angela Edel
 
PPTX
Html images
Denni Domingo
 
PPT
Web Applications
kichu
 
PPTX
HTML5 - Insert images and Apply page backgrounds
Grayzon Gonzales, LPT
 
PDF
Understanding HTML: Creating Text Links for Navigation and Image Links for In...
DlerOsman1
 
PPT
Graphics
buhiterita
 
PDF
ClassJavaScript 1: Language Fundamentals06 .pdf
kasperkey106
 
PPTX
HTML Images & Hyperlinks Presentation ..
ssusere13732
 
PDF
Seo for image
NupurSamaddar2
 
PPTX
Session no 4
Saif Ullah Dar
 
PPTX
Chapter 7: Images
Steve Guinan
 
PPT
jQuery Mobile
Doncho Minkov
 
lecture4.ppt
ssuser08ea44
 
Html images syntax
JayjZens
 
HTML Attributes.pptx
Steins18
 
Designing web page marquee and img tag
Jesus Obenita Jr.
 
Presentation
Bbhulme1
 
Chapter 2.pdf
AnisZahirahAzman
 
Project 03 Creating Web Pages with Links, Images, and Formatted Text
Angela Edel
 
Html images
Denni Domingo
 
Web Applications
kichu
 
HTML5 - Insert images and Apply page backgrounds
Grayzon Gonzales, LPT
 
Understanding HTML: Creating Text Links for Navigation and Image Links for In...
DlerOsman1
 
Graphics
buhiterita
 
ClassJavaScript 1: Language Fundamentals06 .pdf
kasperkey106
 
HTML Images & Hyperlinks Presentation ..
ssusere13732
 
Seo for image
NupurSamaddar2
 
Session no 4
Saif Ullah Dar
 
Chapter 7: Images
Steve Guinan
 
jQuery Mobile
Doncho Minkov
 
Ad

More from Bulldogs83 (18)

PPT
7.2 external style sheets
Bulldogs83
 
PPT
6.2 css link styling
Bulldogs83
 
PPT
6.1 special characters
Bulldogs83
 
PPT
5.2 nesting and floating elements
Bulldogs83
 
PPT
5.1 css box model
Bulldogs83
 
PPT
4.3 table styling
Bulldogs83
 
PPT
4.2 css classes
Bulldogs83
 
PPT
4.1 advanced tables
Bulldogs83
 
PPT
3.2 introduction to css
Bulldogs83
 
PPT
3.1 xhtml tables
Bulldogs83
 
PPT
3.2 introduction to css
Bulldogs83
 
PPT
1.4 adding comments copy (2)
Bulldogs83
 
PPT
1.4 adding comments copy (2)
Bulldogs83
 
PPT
1.3 creating links
Bulldogs83
 
PPT
1.3 creating links
Bulldogs83
 
PPT
1.2 elements and attributes copy (3)
Bulldogs83
 
PPT
1.2 elements and attributes copy (3)
Bulldogs83
 
PPT
1.1 xhtml basics
Bulldogs83
 
7.2 external style sheets
Bulldogs83
 
6.2 css link styling
Bulldogs83
 
6.1 special characters
Bulldogs83
 
5.2 nesting and floating elements
Bulldogs83
 
5.1 css box model
Bulldogs83
 
4.3 table styling
Bulldogs83
 
4.2 css classes
Bulldogs83
 
4.1 advanced tables
Bulldogs83
 
3.2 introduction to css
Bulldogs83
 
3.1 xhtml tables
Bulldogs83
 
3.2 introduction to css
Bulldogs83
 
1.4 adding comments copy (2)
Bulldogs83
 
1.4 adding comments copy (2)
Bulldogs83
 
1.3 creating links
Bulldogs83
 
1.3 creating links
Bulldogs83
 
1.2 elements and attributes copy (3)
Bulldogs83
 
1.2 elements and attributes copy (3)
Bulldogs83
 
1.1 xhtml basics
Bulldogs83
 

Recently uploaded (20)

PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
CDH. pptx
AneetaSharma15
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Virus sequence retrieval from NCBI database
yamunaK13
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 

2.1 adding images

  • 2. XHTML <img> Element <img src= &quot;mypic.jpg&quot; alt= &quot;my text&quot; /> Element Attribute Attribute Value Closing tag Attribute Attribute Value The src attribute supplies the name and location of the image file you wish to display. If no path is specified, the browser will expect the file to be in the same folder as the web page. The alt attribute determines what text will display in the web page if the image is not available. This is also what screen readers (for the visually impaired) will use. Get in the habit of naming image files in all lowercase letters and use underscores or dashes instead of spaces.
  • 3. <img> height and width attributes <img src= &quot;sunset.jpg&quot; height= &quot;600&quot; width= &quot;800&quot; alt= &quot;A beautiful sunset&quot; /> By specifying the height and width attributes of an image, we help the browser display the image correctly on the page. We can use these attributes to make a large image appear smaller on the page. We can also make a smaller image appear larger on the page, but this is not recommended, as the image will look pixelated and of poor quality. When making a large image appear smaller on the page, be sure to keep the same ratio of height to width. If you don't, the resulting image will look &quot;squished&quot; when it displays on the page.
  • 4. Determining the Height and Width: By viewing the properties of an image file in Windows, you can see what the width and height are.
  • 5. Resizing the Height and Width: <img src= &quot;sunset.jpg&quot; height= &quot;300&quot; width= &quot;400&quot; alt= &quot;A beautiful sunset&quot; /> By dividing the height and width evenly, we can resize an image on our web page.
  • 6. Image Formats for the Web: The most common image formats for websites are (. jpg ), (. png ), and (. gif ) extensions. While jpg files are used most often, the other two formats have their own advantages: Supports transparency: Supports animation: Color support: jpg png gif Excellent Excellent Limited       Best suited for: Image Extension: Photographs Logos, Icons Animations