Webstorm上运行html文件Chrome浏览器显示出现乱码解决方法

现象:举个例子

Webstorm运行html时,Chrome浏览器显示出现乱码,如图所示:

<html>
	<head>
		<title>网页的标题yes</title>
	</head>
	<body>
		网页的主体内容
	</body>
</html>

image

解决方法:

代码前面加上一行<meta http-equiv="Content-Type" content="text/html;charset=utf-8">

即:

<meta http-equiv="Content-Type" content="text/html;charset=utf-8">

<html>
	<head>
		<title>网页的标题yes</title>
	</head>
	<body>
		网页的主体内容
	</body>
</html>

image

成功!

posted @ 2022-06-04 20:24  JaxonYe  阅读(447)  评论(0编辑  收藏  举报