我试图在chrome中显示图片,但没有显示。它在vs live服务器中可见,但在chrome中不可见。
当我使用/时,它与vs live服务器一起工作,但在其他浏览器中,后台不起作用
你能帮我解决这个问题吗
下面是代码: html:
<nav id="navbar" class="navbar">
<ul>
<li><a class="nav-link scrollto active" href="#hero">Home</a></li>
<li><a class="nav-link scrollto" href="#about">About</a></li>
<li><a class="nav-link scrollto" href="#services">Services</a></li>
<li><a class="nav-link scrollto" href="#contact">Contact</a></li>
<li><a class="getstarted scrollto" href="indexAR.html">العربيه</a></li>
</ul>
<i class="bi bi-list mobile-nav-toggle"></i>
</nav><!-- .navbar -->
</div>
</header><!-- End Header -->
<!-- ======= Hero Section ======= -->
<section id="hero">
<div class="hero-container" data-aos="fade-up" data-aos-delay="150">
<h1>Plan. Launch. Grow.</h1>
<h2>We hope to create a world where our descendants can enjoy a sustainable future</h2>
<div class="d-flex">
<a href="#about" class="btn-get-started scrollto">Get Started</a>
</div>
</div>
</section><!-- End Hero -->
css:
#hero {
width: 100%;
height: 100vh;
background: url("/assets/img/5secondhome_lon_ii_sca_8820.png") top center;
background-size: cover;
position: relative;
padding: 0;
}
我认为问题来自<link>
元素。
如果您的<link>
具有src
属性,该属性在relative slash
之前以period .
开头,如下所示:
<link rel="stylesheet" href="./css/style.css">
尝试在没有period .
的情况下纠正这个错误<link rel="stylesheet" href="/css/style.css">