首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >eclipse中<head></head>中的缩进标记

eclipse中<head></head>中的缩进标记
EN

Stack Overflow用户
提问于 2014-11-26 10:30:26
回答 1查看 1.4K关注 0票数 21

当我点击<head>...</head> Ctrl+Shift+F时,我需要Eclipse(开普勒)在中缩进html标记。

目前,这方面:

代码语言:javascript
复制
<html>
<head>
<title>Insert title here</title>
<script type="text/javascript">
function func() {
console.log("Hello world");
}
</script>
</head>
<body>
<p onclick="func()">Some text</p>
</body>
</html>

当我按下组合键时就会变成这样。

代码语言:javascript
复制
<html>
<head>
<title>Insert title here</title>
<script type="text/javascript">
    function func() {
        console.log("Hello world");
    }
</script>
</head>
<body>
  <p onclick="func()">Some text</p>
</body>
</html>

我需要缩进<head>...</head>中的所有内容,也需要<html>...</html>中的所有标记。

理想的方式是:

代码语言:javascript
复制
function func() {
  console.log("Hello world");
}
代码语言:javascript
复制
<html>

<head>
  <title>Insert title here</title>
  <script type="text/javascript">
    /* function */
  </script>
</head>

<body>
  <p onclick="func()">Some text</p>
</body>

</html>

EN

回答 1

Stack Overflow用户

发布于 2015-09-27 20:54:05

您可以尝试转到:窗口>首选项> Web > HTML文件>编辑器。

从内联字段中添加/删除要缩进的内容。据我所见,它不包括head标签,所以尝试添加到列表中。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27146756

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档