vs code测试遇到 live reload is not possible without body or head tag问题之解决方案

本文介绍了在使用Live Server插件进行测试时遇到'live reload is not possible without body or head tag'的问题及其解决方案。通过去除CSS文件中的特定注释,保存后在浏览器中测试,问题得到解决,页面恢复正常运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

配合调测的插件是 Liver Server

以下是css文档

/***************************************

   Default Styles

***************************************/

/*  <--要去除
 

html, body {

  margin: 0;

  padding: 0;

}

 

body {

  font: 62.5% Verdana, Helvetica, Arial, sans-serif;

  color: #000;

  background: #fff;

}

#container {

  font-size: 1.2em;

  margin: 10px 2em;

}

 

h1 {

  font-size: 2.5em;

  margin-bottom: 0;

}

 

h2 {

  font-size: 1.3em;

  margin-bottom: .5em;

}

h3 {

  font-size: 1.1em;

  margin-bottom: 0;

}

 

code {

  font-size: 1.2em;

}

 

a {

  color: #06581f;

}

*/  <--要去除
 

/***************************************

   Chapter Styles

***************************************/

/*  <--要去除

#header {

  margin-bottom: 1em;

  padding-bottom: 1em;

  border-bottom: 1px solid #eee;

}


 

.letters {

  float: left;

  width: 15%;

  padding-right: 5%;

}

 

.letter {

  margin: 10px;

}

.letter h3 {

  font-weight: bold;

}

 

.letter ul {

  list-style: none;

  padding: 0;

  margin: 0 1em;

}

 

.letter input {

  width: 100%;

  margin-bottom: 1em;

}


 

#dictionary {

  float: left;

  width: 78%;

}

 

.entry {

  padding: 1em 0em;

  border-bottom: 1px solid #eee;

}

.entry .term {

  display: inline;

  font-weight: bold;

}

.entry .part {

  padding: 0 1em;

  display: inline;

  font-style: italic;

}

.entry .definition {

  padding: .5em;

}

.entry .definition .quote {

  margin: .5em 2em;

  padding: 0 1em;

  color: #333;

  border-left: 2px #eee solid;

}

.entry .definition .quote .quote-author {

  font-weight: bold;

  margin-left: 20em;

}

 

#loading {

  display: none;

  position: fixed;

  left: 50%;

  top: 40%;

  width: 90px;

  padding: 20px;

  margin-left: -66px;

  border: 1px #000 solid;

  background-color: #eee;

}

* html #loading {

  position: absolute;

}

 

.highlighted {

  background-color: #dfd;

  font-style: italic;

}

*/  <--要去除

将这些css注释去掉之后,保存。在测试浏览器中突然自己就运转正常了。

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值