简体   繁体   English

Html 文件不显示任何内容

[英]Html file not displaying anything

This is not displaying anything on the browser when opened from a local host.从本地主机打开时,这不会在浏览器上显示任何内容。 But shows everything when open via live server on VSC Editor但是在 VSC Editor 上通过实时服务器打开时会显示所有内容

<!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>
        

Hope to find any fix.希望能找到任何解决办法。 Please try to review all the sections and i have used the code format correctly请尝试查看所有部分,我已正确使用代码格式

  1. Make sure the file paths are correct (This means that the stylesheet and JavaScript file are in the same location as the HTML file确保文件路径正确(这意味着样式表和 JavaScript 文件与 HTML 文件位于同一位置

  2. Ensure that your cache is cleared, than refresh the page.确保清除缓存,而不是刷新页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM