insert pic in html5
- common pic tags:
(1) src
(2) alt
(3) title
(4) width
(5) height
(6) border
(1) src: The “src” attribute specifies the location (URL) of the external resource. It applied to insert pic.
!!!PAY ATTENTION
We only can use pic where in folder, otherwise computer cannnot identify them.
scr likes index to get file’s path.
(2)alt: full word is alternative, which means it is able to show words when pic not working.
!!
Taking second pic as a example, we see easily is that second pic not working anymore. However we also can through alt to show some words to audience(3) title: A title tag is an HTML element that specifies the title of a web page. Title tags are displayed on search engine results pages (SERPs) as the clickable headline for a given result, and are important for usability, SEO, and social sharing.
For width, height and border. I did not show them in my code. How to use them? It is same with scr alt and title. Just code what pixel you want to use in the same line ending.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h4>use of image tag</h4>
<img src = "Marine.jpg"/>
<h4>use of alt tag,for scenario when pic cannt appera then we use words toalternative </h4>
<img src = "Marine1.jpg" alt = "I am marine"/>
<h3>title people are able to see the word when then caps on the pic</h3>
<img src = "Marine.jpg" alt = "I am marint" title = "I am Marine 思密达"/>
</body>
</html>