본문 바로가기
Information Technology/HTML5

[HTML5] 05. Training for Directory

by Patrick Moon 2019. 8. 19.

At First, Create a folder where you want in desktop directory

and migrate imagefiles I made previous class time into created folder.

1-1. Create folder named "Data"

 

1-2. And Migrated into Data with files

Now, you can view the files and folder

1-3. It will be printed as above (error path for demonstrated IMG)
** The directory is recognized as a file in the same path as html. **

 

 

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

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


 

 

Final. In case already migrated to another filder with html such as below?

 

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

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

댓글