3

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

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

6 Comments

Nothing has changed
This shortcut only formats within the area you select; does not make the selected area compatible with the file-wide format.
See my screenshots in question.
I am using Prettier plugin. The difference may be due to the plugins used.
You made screenshot in HTML file - not PHP. The problem is in PHP files. Try it.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.