【发布时间】:2020-08-10 03:25:46
【问题描述】:
- 我引用和图像为
<img src="public/assets/images/sydney.jpg" alt=""/> - 我将我的 jpg 图像放在
public/assets/images文件夹中。 - 然后我使用
npm start成功构建,但是,当我进入我的站点时,图像不存在。 如果您需要更多信息,请发表评论。这是一些截图
谢谢
Here is the app, I want the image to appear in the Sydney FC Box.
import React from 'react';
import React from 'react';
export const ALeagueTeam = () => {
return (
<div>
<section id="one" class="tiles">
<article>
<span class="image">
<img src="public/assets/images/sydney.jpg" alt=""/>
</span>
<header class="major">
<h3><a href="landing.html" class="link">SYDNEY FC</a></h3>
<p>FOUNDED IN 2004</p>
</header>
</article>
<article>
<span class="image">
<img src="images/pic02.jpg" alt=""/>
</span>
<header class="major">
<h3><a href="landing.html" class="link">VIEW PLAYERS</a></h3>
<p>CURRENTLY 1st</p>
</header>
</article>
<article>
<span class="image">
<img src="images/pic03.jpg" alt=""/>
</span>
<header class="major">
<h3><a href="landing.html" class="link">MELBOURNE CITY</a></h3>
<p>FOUNDED IN</p>
</header>
</article>
<article>
<span class="image">
<img src="images/pic04.jpg" alt=""/>
</span>
<header class="major">
<h3><a href="landing.html" class="link">VIEW PLAYERS</a></h3>
<p>CURRENTLY 2ND</p>
</header>
</article>
<article>
<span class="image">
<img src="images/pic05.jpg" alt=""/>
</span>
<header class="major">
<h3><a href="landing.html" class="link">WELLINGTON PHOENIX</a></h3>
<p>FOUNDED IN </p>
</header>
</article>
<article>
<span class="image">
<img src="images/pic06.jpg" alt=""/>
</span>
<header class="major">
<h3><a href="landing.html" class="link">VIEW PLAYERS</a></h3>
<p>CURRENTLY 3RD</p>
</header>
</article>
</section>
</div>
);
};
【问题讨论】:
-
您可以将图像中的代码移到问题中吗?该站点有一个您可以使用的代码块系统。当您编辑/发布问题时,就是这个符号 {}
-
@TheGrandJ 有代码 :) " " 那部分
标签: javascript java reactjs