Change behaviour of auto indenting inside html and body tag

Can I change behaviour of auto indenting inside html and body tag?

Current situation:

<!DOCTYPE html>
<html>
  <head>
    <title></title>
  </head>
  <body>|
  </body>
</html>


This happens after pressing Enter:

...
<body>
|
</body>
...


I am expecting this:

...
<body>
  |
</body>
...

2
5 comments

Yes, Marek, you can. Go to Settings|Code Style|HTML. In "Do not indent children of" just remove the "body" tag. That should be it.

14

Amazing, thanks.

0

Even though I remove the 'body' tag, It doens't work at all. 

How can I solve this problem?

0

works fine for me:

please share the .html file that shows up the issue

0

In case anyone else arrives here after having trouble with changes to the “Do not indent children of” setting not appearing to work:  it only took effect for me after I closed and restarted WebStorm.  (WebStorm 2023.2.2, Ubuntu 22.04.3)

0

Please sign in to leave a comment.