首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在托管在heroku上的html文件中显示图像?

如何在托管在heroku上的html文件中显示图像?
EN

Stack Overflow用户
提问于 2022-06-24 10:00:22
回答 1查看 17关注 0票数 -1

大家好大家都在看这个。

总之,我试图为我的heroku应用程序创建一个网页,但是当我试图在上面添加图片时,它们不会打印。到目前为止,我的文件是这样组织的:

主文件

  • index.js
  • Front
    • adding.html
    • pic.png

当然,名字不完全是那些,但你明白重点

我在html文件中调用它们的方式是:

代码语言:javascript
复制
<!DOCTYPE html>
<html>
    <head>
        <title>
            Hub2Boond - Ajout d'utilisateur
        </title>
         
        <!-- templates -->
        <style>
            .bgQueriadis {
                background-color: rgb(129,192,240);
                width: 400px;
                position: absolute;
                top: 150px;
                left: 40%;
                width: 450px;
                bottom:50px;
            }
        </style>
        <style>
            .logoQueriadis {
                background-color: rgb(54,80,100);
                width: 400px;
                position: absolute;
                bottom: 0%;
                left: 0%;
                width: 100%;
                height: 50px;
            }
        </style>
        <style>
            .logoAPI {
                background-color: rgb(54,80,100);
                width: 400px;
                position: absolute;
                top: 0%;
                left:0%;
                width: 100%;
                height: 150px;
            }
        </style>
        
    </head>
    <body>
        <div class="logoAPI">
            <p><br>&nbsp &nbsp &nbsp
            <img src="./HubSpot_LogoWBG.png" alt="Logo Hubspot" height="76px" style="margin: auto;">
            <img src="https://cdn-icons-png.flaticon.com/512/0/248.png" alt="pretty arrow" height="76px" style="margin: auto;">
            <img src="./BoondTR.png" alt="LogoBoondManager" height="76px" style="margin: auto;">
            </p>
        </div>
        <div class="bgQueriadis">
            <br><br>
            <p style="margin: auto; width: 400px;font-family: 'Raleway', sans-serif;font-size: 40px;">Informations enregistrées avec succès, vous pouvez quitter la page!</p>
        </div>
        <div class="logoQueriadis">
            <p style="font-family: 'Raleway', sans-serif; color:white;">By Queriadis Consulting &nbsp<img src="./a2f8383a-a348-4d95-a059-3ae2fb574171.png" alt="Logo Queriadis" height="20px" style="margin: auto;">
            </p>
        </div>
    </body>
</html>

我知道它的代码很差,我仍然是一个初学者,但任何帮助,想法或纠正都是非常感谢的。谢谢

EN

回答 1

Stack Overflow用户

发布于 2022-06-24 18:58:00

代码有点不清楚,但我有一些建议。首先,我建议不要使用本地图像(存储在计算机上的图像),而应该使用已经存在于互联网上的图像。根据我的经验,在公共或半公共网站上树立当地形象可能会引发问题.第二,在指定图像高度的引号中,不需要在数字之后使用px。例如:

代码语言:javascript
复制
  height = "76"  NOT height = "76px"

这里有关于初学者图像格式的更多资源:https://www.w3schools.com/html/html_images.asp#:~:text=Try%20it%20Yourself%20%C2%BB-,HTML%20Images%20Syntax,-The%20HTML%20%3Cimg

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72742294

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档