【问题标题】:Intellisense not working to autocomplete things on HTMLIntellisense 无法自动完成 HTML 上的内容
【发布时间】:2021-08-31 08:08:12
【问题描述】:

你们好吗?希望你们一切都好。

我对 VSCode 的 IntelliSense 有一点问题,它适用于我的 CSS 文件,但停止适用于 HTML 文件。 Here is an example.我输入了一个“。”用一个类创建一个 div,但是 vscode 没有显示任何自动完成选项,甚至没有关闭我添加的新标签。

我在这里测试过,这个问题就在这段代码中。当我创建一个新的 HTML 文件时,它工作正常。我尝试创建一个新文件并复制代码,但是当我粘贴代码时它停止工作。

这是 HTML 代码:

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- displays site properly based on user's device -->


  <link rel="preconnect" href="https://fonts.gstatic.com">
  <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Poppins:wght@600&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="css/style.css">
  <script src="https://kit.fontawesome.com/67c8471bba.js" crossorigin="anonymous"></script>

  <link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
  <title>Frontend Mentor | Huddle landing page with alternating feature blocks</title>

</head>

<body>

  <header class="container">

    <div class="header-content">

      <img src="images/logo.svg" alt="huddle-logo">
      <a href="#">Try It Free</a>

    </div>
    
  </header>

  <div id="hero" class="container">
    <h1>Build The Community Your Fans Will Love</h1>
    <p>Huddle re-imagines the way we build communities. You have a voice, but so does your audience.
      Create connections with your users as you engage in genuine discussion.
    </p>
    <a href="">Get Started For Free</a>
    <img src="images/illustration-mockups.svg" alt="illustration-mockups">
    
  </div>

  <article>

    <div class="card">
      <img src="./images/illustration-grow-together.svg" alt="illustration-grow-together">
      <h1>Grow Together</h1>
      <p>Generate meaningful discussions with your audience and build a strong, loyal community.
        Think of the insightful conversations you miss out on with a feedback form.</p>
      
    </div>
    <div class="card">
      <img src="./images/illustration-flowing-conversation.svg" alt="illustration-flowing-conversation">
      <h1>Flowing Conversations</h1>
      <p>You wouldn't paginate a conversation in real life, so why do it online? Our threads
        have just-in-time loading for a more natural flow.</p>      
    </div>
    <div class="card">
      <img src="./images/illustration-your-users.svg" alt="illustration-your-users">
      <h1>Your Users</h1>
      <p>It takes no time at all to integrate Huddle with your app's authentication solution.
        This means, once signed in to your app, your users can start chatting immediately.</p>      
    </div>
    <div id="call-to-action" class="card">
      <h1>Ready To Build Your Community?</h1>

      <a href="">Get Started For Free</a>
    </div>

  </article>

  <footer>
    <div class="get-in-touch">
      <img src="images/logo-white.svg" alt="huddle-logo">
      <div class="adress">
        <i class="fas fa-map-marker-alt"></i>
        <p>Lorem ipsum dolor sit amet, <br>consectetur adipiscing elit, sed do eiusmod tempor
          incididunt ut labore et dolore magna aliqua</p>
      </div>
      <div class="phone">
        <i class="fas fa-phone-alt"></i>
        <p>+1-543-123-4567</p>
      </div>
      <div class="email">
        <i class="fas fa-envelope"></i>
        <p>example@huddle.com</p>
      </div>
    </div>
    <div class="links">
      <div class="link1">
        <a href="#">About Us</a>
        <a href="#">What We Do</a>
        <a href="#">FAQ</a>
      </div>
      <div class="link2">
        <a href="#">Career</a>
        <a href="#">Blog</a>
        <a href="#">Contact Us</a>
      </div>
    </div>
    <div class="socials">

      <a href="#" <i class="fab fa-facebook-f"></i></a>
      <a href="#" <i class="fab fa-twitter"></i></a>
      <a href="#" <i class="fab fa-instagram"></i></a>

    </div>
    <p class="copyright">&copy; Copyright 2018 Huddle. All rights reserved.</p>
    
    <p class="attribution">
      Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
      Coded by <a href="https://www.frontendmentor.io/profile/vitorlfaria" target="_blank">Vitor Lacerda</a>.
    </p>
  </footer>
</body>

</html>

【问题讨论】:

    标签: html visual-studio-code intellisense


    【解决方案1】:

    不要为 div 写 .hero-infos。 输入div.hero-infos

    【讨论】:

    • 它也不起作用。我在这里做了一些测试,发现这是代码的一些问题。我已经用更多信息和代码更新了线程。
    猜你喜欢
    • 2021-11-26
    • 2016-02-19
    • 1970-01-01
    • 2011-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-01
    • 2016-09-23
    相关资源
    最近更新 更多