Images can improve the design and the appearance of a web page.
01_ Attributes
02_ Image Size - Width and Height
<img src="" alt="" style="width:300px; height:300px;">
03_ Width and Height, or Style?
04_ HTML Screen Readers
05_ HTML Image Maps
<map>
태그는 이미지 맵을 정의한다. 이미지 맵은 클릭가능한 영역을 의미한다<img src="" alt="" usemap="#workmap">
<map name="workmap">
<area shape="rect" coords="34,44,270,350" alt="computer" href="computer.html">
06_ The Areas
1) shape
-rect : (x,y) 좌표로 left-top 꼭지점과 right-bottom 꼭지점을 찍어서 사각형을 잡는다.
-circle : (x,y) 좌표로 원의 중심을 잡고 반지름을 이용하여 원을 그린다.
-poly
-default : 완전한 영역
07_ Background Cover
1) background-size: cover
2) background-attachment: fixed;
Note.
위와 같이 이미지 커버 적용시, 뻗치는거 없이 원래 비율을 유지하게 된다.
08_ Background Stretch
09_ The HTML <picture>
Element
<source>
요소를 포함한다.<source>
요소는 그 이미지가 가장 적합한 때를 기술한다.<picture>
<source media="(min-width: 650px)" srcset="img_food.jpg">
<source media="(min-width: 465px)" srcset="img_car.jpg">
<img src="img_girl.jpg">
</picture>
img
요소는 항상 picture
요소의 마지막 자식에 명시해야한다. 브라우저가 지원하지 않는 요소이거나 source
태그와 매치되는게 없을 때 사용되기 때문이다.Note.
브라우저는 매칭되는 속성값이 있으면 첫번째 source
요소를 사용한다.