Note: Images are not technically inserted into an HTML page, images are linked to HTML pages. The <img>
tag creates a holding space for the referenced image.
<img>
Attributes
src=" "
the URL of an image requiredalt=" "
an alternate text for an image requiredwidth=" "
the width of an imageheight=" "
the height of an image
<img
src="images/chiquita-banana-minion.jpg" alt="Chiquita Banana Minion" width="150px"
>
Setting the style of an HTML element, can be done with the style
attribute. See HTML Style Attribute and/or HTML Color Names for more info.
<tagname
style
="property:value;"
>
</tagname
>
<p
style="background-color:aquamarine;"
>
This paragraph has a background-color of aquamarine.
</p>
This paragraph has a background-color of aquamarine.
<p
style="color:slateblue;"
>
This sentence has a font color of SlateBlue.
</p>
This sentence has a font color of SlateBlue.
style="font-family:cursive;"
This sentence has a font style of cursive."
style="font-family:fantasy;"
This sentence has a font style of fantasy."
style="font-family:san-serif;"
This sentence has a font style of sans-serif."
style="text-align:center;"
This sentence is centered."