vue3新建项目后,发现页面四周有留白
解决办法:
修改index.html样式
添加样式
<style>
body{
margin:0;
padding:0;
}
</style>
index.html 如下
<!DOCTYPE html>
<style>
body{
margin:0;
padding:0;
}
</style>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
结果