【发布时间】:2021-11-09 10:13:36
【问题描述】:
当从本地主机打开时,它不会在浏览器上显示任何内容。但是通过 VSC 编辑器上的实时服务器打开时会显示所有内容
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>Expanding Cards</title>
</head>
<body>
<div class="container">
<div class="panel active" style="background-image: url(/images/messi.jpg);">
<h3>Lionel Messi</h3>
</div>
<div class="panel" style="background-image: url(/images/pique.jpg);">
<h3>Gerard Pique</h3>
</div>
<div class="panel" style="background-image: url(/images/pedri.jpg);">
<h3>Pedri Gonzalez</h3>
</div>
<div class="panel" style="background-image: url(/images/alba.jpg);">
<h3>Jordi Alba</h3>
</div>
<div class="panel" style="background-image: url(/images/griezmann.webp);">
<h3>Antoine Griezmann</h3>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
希望找到任何解决方法。请尝试查看所有部分,我已正确使用代码格式
【问题讨论】:
-
在控制台中查找任何错误。如果可以,请提供更多详细信息
-
欢迎来到 StackOverflow,请更新您的问题,否则它将被否决和/或关闭。只写“我写了代码,但它不起作用”不是社区要求的形式的问题。首先请阅读how to ask a question
-
请提供有关代码/任何错误的更多信息?
-
您可以添加有关应用程序上显示的内容或您如何运行此 HTML 页面的信息。 @WaliWaqar 如果请求至少到达所需页面,查看控制台错误是一个不错的选择。
-
@WaliWaqar 更新
标签: javascript html css reactjs