본문 바로가기
Information Technology/HTML5

[HTML5] 04. Training for IMG Tag (Image Tag)

by Patrick Moon 2019. 8. 18.

1-1. href Image1

**Caution: Image has no rules of closing tag!

Making Sample to do testing IMG Tag

Then, save as another file (.png)

 

 

Start Coding for this!

<!DOCTYPE html>
<html>
    <head>
        <title>Sample</title>
    </head>
    <body> 
        <div>
            <a href="http://www.imagesample.com">
            <img src="./imgtag\img_sample.png">
            Image example
            </a>
        </div>
    </body>
</html>


 

Results

When image insertion is complete

 

1-2. href Image1 + href Image2

<!DOCTYPE html>
<html>
    <head>
        <title>Sample</title>
    </head>
    <body> 
            <div>
                <a href="http://www.imagesample.com">
                <img src="./imgtag\img_sample.png">
                Image example
                </a>
            </div>

            <div>
                    <a href="http://www.imagesample.com">
                    <img src="./imgtag\img_sample2.png"width = "400px" height="250px" > 
                    Image example #2
                    </a>
            </div>
    </body>
</html>


 

 

 

1-3. href Image1 + href Image2 + Just Image3

<!DOCTYPE html>
<html>
    <head>
        <title>Sample</title>
    </head>
    <body> 
            <div>
                <a href="http://www.imagesample.com">
                <img src="./imgtag\img_sample.png">
                Image example
                </a>
            </div>

            <div>
                    <a href="http://www.imagesample.com">
                    <img src="./imgtag\img_sample2.png"width = "400px" height="250px" > 
                    Image example #2
                    </a>
            </div>
            
            <div>
                    <img src="./imgtag\img_sample3.png"width = "400px" height="auto" > 
                    Image example #2
                    </a>
            </div>
    </body>
</html>

댓글