Front-End/HTML5 + CSS

[HTML5] 5. Image

리딩리드 2016. 8. 4. 18:47

5. Image


5_1. <img>

- The tag is empty, it contains attributes only, and does not have a closing tag

Attribute

1) src : This attribute specifies the URL of the image


2) alt : The alt attribute provides an alternate text for image, if browser cannot find an image, it will display the value of the alt attribute

3) width and Height

- You can use the style attribute to specify the width and height of an image

Always specify the width and height of an image, If width and height are not specified, the page will flicker while the image loads

- It is suggested using the style attribute, it prevents internal or external styles sheets from changing the original size of images