简体   繁体   English

为什么 Live Server 只加载一半的 HTML 代码?

[英]Why is Live Server only loading half my HTML code?

I have searched the internet for hours trying to find someone else who shared my issue, but it seems to be entirely unique to me.我在互联网上搜索了几个小时,试图找到与我分享我的问题的其他人,但这对我来说似乎完全是独一无二的。

So basically, I launch my very small HTML file with live server, but only 2 divs are loaded on the webpage, and I have no idea why.所以基本上,我用实时服务器启动我的非常小的 HTML 文件,但网页上只加载了 2 个 div,我不知道为什么。 I have tested it and narrowed it down to purely being an issue caused by live server, as my html file loads completely fine when the file itself is double-clicked on from file explorer, and I still have the issue when i remove my links to my css and js files from the hmtl file.我已经对其进行了测试并将其范围缩小到纯粹是由实时服务器引起的问题,因为当从文件资源管理器双击文件本身时,我的 html 文件加载完全正常,当我删除我的链接时,我仍然遇到问题我的 css 和 js 文件来自 hmtl 文件。

this happens on the simplest of code, and its so annoying.这发生在最简单的代码上,非常烦人。

here is some simple code:这是一些简单的代码:

在此处输入图片说明

and here is the screenshot of the elements not loading:这是未加载元素的屏幕截图:

在此处输入图片说明

and i also show the "code injected by live server" bit, cause i think that might be the issue?而且我还显示了“由实时服务器注入的代码”位,因为我认为这可能是问题所在?

please help, this is driving me crazy.请帮忙,这让我发疯。 ps.附: i am a newbie to live server and website making.我是实时服务器和网站制作的新手。

There can only be one body tag in whole HTML file.整个 HTML 文件中只能有一个 body 标签。 You can try this instead :你可以试试这个:

 <html> <head> <title>HTML page</title> </head> <body> <div> <p>text</p> </div> <div> <p>text</p> </div> <div> <p>text</p> </div> <div> <p>text</p> </div> </body> </html>

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

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