简体   繁体   中英

Swift Vapor 4 Leaf Image not displayed in view on run

I am doing my first steps in vapor 4 using leaf as view renderer. In my data i am pasting image urls but when I run the page the browser does not show them. The browser always shows the value of the "alt" tag. So I tried to build a static leaf page which only shows an image from the internet but this is also not displaying the image. I can not figure out why. Do I have to set somewhere that the running test Webserver should render images? I am using macOS Big Sur 11.0.1

Here is my leaf code (it's simple html code but does not display the image)

<!DOCTYPE html>
<html>
    <head>
        <title>Image Test</title>
    </head>
<body>
    <a href="https://www.w3schools.com/tags/img_girl.jpg">
        <img scr="https://www.w3schools.com/tags/img_girl.jpg" alt="test image" width="500" height="600">
    </a>
</body>
</html>

As Nick said it was a speeling mistake.

I wrote „scr“, but it must be „src“ Correct:

<img src="https://www.w3schools.com/tags/img_girl.jpg" alt="test image" width="500" height="600">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM