Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

images html

<!--An image tag (img for short). The attributes src= and alt= are essential. 
src= is short for source, which will be the link to the relative or absolute 
image link, alt= is additional information for the users on screen readers etc. 
Just so you know, you MUST have the src= attribute but the alt= attribute is optional.
Like the abbr tag, img also has the title= attribute. -->
<!--Also the height= and width= attributes to control the height and width separately. 
Enough with the attributes, the img tag is a SELF-closing tag, meaning it doesn’t have 
a closing tag, like so:-->

<img src=”hello-world.png” alt=”print(“Hello World!”)> 

<!--Relative: The image is in the folder where your index.html file is located. 
Write the file path down in the src= attribute. Example:-->

<img src=”images/hello-world.png>

<!--Absolute: The opposite of relative, this time, the image is a link to an 
image somewhere on the internet. Write the file path down in the src= attribute. 
Example: -->

<img src="https://d1y8sb8igg2f8e.cloudfront.net/images/shutterstock_1375463840.2e16d0ba.fill-1200x630.jpg">
 
PREVIOUS NEXT
Tagged: #images #html
ADD COMMENT
Topic
Name
6+7 =