【问题标题】:cannot acces a image from file in html website无法从 html 网站中的文件访问图像
【发布时间】:2020-07-31 19:06:15
【问题描述】:

output:Screen shot of browser

 <!-- Add icon library -->
<html>
 <body class="body">
 <center>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<div class="card">
  <img src="{{url_for('static', filename='file:/omkar.png')}}align="middle" />
  <h1>Omkar More</h1>
  <p class="title">Student DYPSOEA</p>
  <p>PUNE UNIVERSITY</p>
  <a href="#"><i class="fa fa-dribbble"></i></a>
  <a href="#"><i class="fa fa-twitter"></i></a>
  <a href="#"><i class="fa fa-linkedin"></i></a>
  <a href="#"><i class="fa fa-facebook"></i></a>
  <
</div>
   </center>
  </body>
</html>

上面的代码只给出了图像的符号而不显示它

【问题讨论】:

标签: html css python-3.x web file-upload


【解决方案1】:

尝试关闭 img src 属性。

【讨论】:

    【解决方案2】:

    您缺少关闭 "align="middle" 之前的空格

    见下面的html

    <img src="{{url_for('static', filename='file:/omkar.png')}}" align="middle" />
    

    【讨论】:

      【解决方案3】:

      看看这个:

      你的img标签语法不正确,这里是正确的。

      <img src="{{url_for('static', filename='file:/omkar.png')}}" align="middle" />
      

      <html>
      
      <body class="body">
        <center>
          <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
      
          <div class="card">
      
            <img src="http://placekitten.com/301/301" align="middle">
      
            <h1>Omkar More</h1>
            <p class="title">Student DYPSOEA</p>
            <p>PUNE UNIVERSITY</p>
            <a href="#"><i class="fa fa-dribbble"></i></a>
            <a href="#"><i class="fa fa-twitter"></i></a>
            <a href="#"><i class="fa fa-linkedin"></i></a>
            <a href="#"><i class="fa fa-facebook"></i></a>
      
          </div>
        </center>
      </body>
      
      </html>

      【讨论】:

        猜你喜欢
        • 2020-12-11
        • 2010-11-06
        • 1970-01-01
        • 1970-01-01
        • 2014-06-30
        • 1970-01-01
        • 2015-07-31
        • 1970-01-01
        • 2017-05-14
        相关资源
        最近更新 更多