html 为什么是我的a和img标签不工作?没有我的图像和图像链接是工作[关闭]

qeeaahzv  于 2022-12-16  发布在  其他
关注(0)|答案(2)|浏览(107)

**已关闭。**此问题需要debugging details。当前不接受答案。

编辑问题以包含desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将有助于其他人回答问题。
2小时前关门了。
Improve this question
我的图片没有加载到网站上,唯一的事情是出现的alt文本
这些要么是一个图像,要么是一个链接的图像更多信息:加载资源失败:服务器响应状态404(未找到)〈-这是它说我的网站上的inspect元素和是的,我所有的文件都是为了所有我的图像都在一个img文件夹正确标记这些图像是代码,也当我把旧代码到同一个文件夹它也停止工作,这是否意味着有什么问题的文件夹?
J321档案袋

<link rel="stylesheet" type="text/css" href="style.css">
     <style>
            body{
        background-color: #FCFCF5;
        }

     h1 {
     padding-bottom: 20px;
     padding-top: 30px;
        }

    #move {margin: 0 auto; padding-left: 230px; width: auto; height: 300px;}

        p { width: 350px; padding-left: 150px;}
         h2 { padding-left: 150px;}
     #wide {margin: 0 auto; padding-left: 230px; width: auto; height: 300px;}
      </style>
      </head>
       <body>
      <div id="nav-wrapper">
     <div id="nav">
             <ul>
               <li><a href="home.html" class="active">Home</a></li>
             <li><a href="about.html" class="active">About</a></li>
           <li><a href="gallery.html" class="active">Gallery</a></li>
             <li><a href="bylines.html" class="active">Bylines</a></li>
          <li><a href="portfolio.html" class="active">J321 Portfolio</a></li>
       </ul>

    </div>
   <div class="clearfloat"></div>
    </div>  
   <h1>J321 Portfolio</h1>
      <h2>Course Reflection</h2>
   <h2>Midterm</h2>
   <h2>Final</h2>
    <h2>Instagram Story</h2>
   <div id="wide">
       <iframe width="560" height="315" src="https://www.youtube.com/embed/HihXQD33yL0" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>. </iframe>
 </div>
  <h2>Infographic</h2>
   <div id="move">
   <img src="img/nebiyu-infographic.png" alt="infographic on UCLA student worker strike">
   </div>
   <div class="footer">
     <p>Salome Nebiyu &copy; 2022</p>
    </div>
  </body>
 </html>
<!DOCTYPE html>
<html>
<head>
<title> Bylines </title>
<link rel="stylesheet" type="text/css" href="style.css">
<style>
        body{
        background-color: #FCFCF5;
        margin-bottom: 30px;
    }

    h3 { padding-left: 160px; padding-top: 20px;}

    iframe {
            width: 560px;
            height: 315px;
            border:none;
            padding-left: 160px;
        }

        h4 { padding-left: 60px; padding-top: 20px;}

        img { width: 30%; overflow:hidden; }

#gallery {display: block; margin: 0 auto; padding-left: 60px; margin-top: 30px; padding-bottom: 60px;}

</style>
</head>
<body>
<div id="nav-wrapper">
<div id="nav">
        <ul>
            <li><a href="home.html" class="active">Home</a></li>
            <li><a href="about.html" class="active">About</a></li>
            <li><a href="gallery.html" class="active">Gallery</a></li>
            <li><a href="bylines.html" class="active">Bylines</a></li>
            <li><a href="portfolio.html" class="active">J321 Portfolio</a></li>
        </ul>

</div>
<div class="clearfloat"></div>
</div>  
<h1>Bylines</h1>
    <h3>Annenberg Media </h3>

    <h4>ARN Segment: California Proposition 31 (1:01:53)</h4>
    <iframe width="560" height="315" src="https://www.youtube.com/embed/n5dO6ieixOs" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<a href="help.html" class="active">Bylines</a>
<div id="gallery">
    <h4>Digital</h4>
<a target="_blank" href="https://www.uscannenbergmedia.com/2022/12/02/woman-life-freedom-iranians-at-usc-host-march-supporting-anti-government-movements-in-iran/"><img src="img/img1.png" alt="photo of iran protest"></a>
<a target="_blank" href="https://www.uscannenbergmedia.com/2022/11/02/usc-and-los-angeles-celebrate-native-american-heritage-month/"><img src="img/img2.png" alt="photo of people"></a>
<a href="https://www.uscannenbergmedia.com/2022/11/30/uscs-movement-for-an-on-campus-skate-park-gains-traction-with-official-petition/"><img src="img/img3.png" alt="photo of signs" target="_blank" ></a>
<a target="_blank" href="https://www.uscannenbergmedia.com/2022/11/16/ucla-teacher-assistants-and-researchers-continue-striking-for-better-wages/"><img src="img/img4.png" alt="photo of strikers"></a>
<a target="_blank" href="https://www.uscannenbergmedia.com/2022/11/09/in-the-west-the-votes-have-been-cast-but-the-results-might-take-a-little-while/"><img src="img/img5.png" alt="photo of person"></a>
<a target="_blank" href="https://www.uscannenbergmedia.com/2022/10/26/on-the-hunt-for-rick-carusos-mega-yacht/"><img src="/Users/bruh/Desktop/itp104-submissions-snebiyu/final/img/img6.png" alt="photo of phone"></a>
<a target="_blank" href="https://www.uscannenbergmedia.com/2022/10/26/usc-urban-planning-podcast-hopes-to-effect-change/"><img src="img/img7.png" alt="photo of crosswalk"></a>
<a target="_blank" href="https://www.uscannenbergmedia.com/2022/10/05/usc-football-is-back-and-so-are-ticket-scams/"><img src="img/img8.png" alt="photo of phone"></a>
<a target="_blank" href="https://www.uscannenbergmedia.com/2022/09/29/usc-offers-flu-shots-to-get-ahead-of-flu-season/"><img src="img/img9.png" alt="photo of person"></a>
<a target="_blank" href="https://www.uscannenbergmedia.com/2022/09/21/annenberg-at-50-students-and-faculty-reflect/"><img src="img/img10.png" alt="photo of person"></a>
<a target="_blank" href="https://www.uscannenbergmedia.com/2022/09/09/extreme-heat-wave-puts-usc-at-risk-of-power-outage/"><img src="img/img11.png" alt="photo of person"></a>

</div>
<div class="footer">
         <p> &copy; 2022</p>
    </div>
</body>
</html>
eit6fx6z

eit6fx6z1#

正如错字先生所说,删除alt属性,而且,锚标记中没有src属性,所以如果你真的想要一个图像链接,试试这样做。

<a href="http://example.com" target="_blank">
    <img src="https://cdn.mos.cms.futurecdn.net/8gzcr6RpGStvZFA2qRt4v6.jpg" alt="Example text"/>
</a> 

<!-- Youtube logo is the image used in the example. -->

也可能是因为图片试图从一个不存在的相对路径加载。尝试使用一个绝对路径/链接,看看是否可以。

qlfbtfca

qlfbtfca2#

兄弟在你的代码语法错误,所以浏览器不显示前端错误.你必须正确关闭所有标签.

<a>
  <img src="img.jpg" alt="Text If image not Loaded THis text Will be loaded" width="500" height="600">
</a>

此代码可能会帮助您

相关问题