HTML - CSS/html 공부

[HTML] img 태그

congs 2023. 4. 5. 16:14

 img 태그

: <input type = "image"> 와 동일 기능

 

  • width : 이미지 가로길이        
  • height : 이미지 세로길이    
  • auto : 비율에 맞춰 자동생성
  • 차이점
    • input태그사용시, 사진위에 마우스를 올리면 손가락모양으로 변경됨 
    • img태그는 변경x

 

아래 이미지 클릭시 우)네이버연결,  좌)다음연결+포인터모양변경

 

<!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>
    <img src="/image/냥3.jpg" alt="사진없음" width="100px" height="auto">
    <input type="image" src="/image/냥1.jpg" width="100px" height="auto">
    <!-- input태그사용시, 사진위에 마우스를 올리면 손가락모양으로 변경됨 -->
    <hr>
    <a href="http://www.naver.com" target="_blank">
        <img src="/image/냥1.jpg" alt="사진없음" width="100px" height="auto"></a>
    <a href="http://daum.net" target="_blank">
        <input type="image" src="/image/냥3.jpg" width="100px" height="auto"></a>
</body>
</html>

 

'HTML - CSS > html 공부' 카테고리의 다른 글

[HTML] style 태그  (0) 2023.04.05
[HTML] ifame 태그  (0) 2023.04.05
[HTML] table 태그  (0) 2023.04.05
[HTML] list 태그  (0) 2023.04.05
[HTML] textarea 태그  (0) 2023.04.05