笔者使用的开发工具是huilderx
笔者的代码格式如下
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />
<script src="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"></script>
<script src="https://api.windy.com/assets/map-forecast/libBoot.js"></script>
<style>
#windy {
width: 100%;
height: 300px;
}
</style>
</head>
<body>
<div id="windy"></div>
<script src="script.js"></script>
</body>
</html>
但是按快捷键Ctrl+Shift+F 格式化之后,代码增加了很多tab
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />
<script src="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"></script>
<script src="https://api.windy.com/assets/map-forecast/libBoot.js"></script>
<style>
#windy {
width: 100%;
height: 300px;
}
</style>
</head>
<body>
<div id="windy"></div>
<script src="script.js"></script>
</body>
</html>
hbuilder x格式化如何设置
hdea和body不缩进
meta,script,style 在head下不缩进
body下的直接子元素不缩进
0 个回复