Home > front end >  Visual Studio Code: Format Selection not working in PHP files with HTML
Visual Studio Code: Format Selection not working in PHP files with HTML

Time:12-23

I have VS Code version 1.63.2 with a problem.

I want to format some selection of HTML in PHP file. But the whole document is formatted as if I clicked on Format Document. How to solve this problem?

Step 1

Step 2

CodePudding user response:

Install Format HTML in PHP extension in VS Code. Select the HTML codes you want to format in the *.php file and click the Format HTML in PHP option ( CTRL ALT F) in the right-click menu.

  • Related