Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code: Format Selection not working in PHP files with HTML

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

like image 683
RU Dremin Avatar asked May 04 '26 19:05

RU Dremin


1 Answers

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.

like image 198
Sercan Avatar answered May 07 '26 09:05

Sercan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!