Auto-completing HTML attributes and classes

murugappan

New member
Hi,

I am using VS code IDE for development and i am having problem is getting auto-completion working for HTML in PHP scripts. I have already set the emmet for PHP and it works fine as far as the main tags are concerned. But it does work when i enter somethings like these:

(1) Enter class= it does not autocomplete to class=""
(2) Enter <div style="color: red"> Test </div>, the color decorators does not work.
(3) This too does not work:

<style>
.login-box {
color: red;
}

</style>

Can anyone help? I am going nuts over this.
 
It seems like you're experiencing issues with HTML autocompletion and syntax highlighting within PHP scripts in VS Code.
  1. Install and enable the "HTML" extension in VS Code.
  2. Verify that the necessary settings for Emmet and HTML are properly configured in your VS Code settings.
  3. Make sure your PHP files have the ".php" extension.
  4. Disable any conflicting extensions or settings.
  5. If the issue persists, consider resetting your VS Code settings to their defaults.
If the problem continues, you may want to seek help from the VS Code community or report the issue to the relevant extension developers for further assistance.
 
1. You need to verify Emmet for PHP settings,
  • Open VS Code settings (File > Preferences > Settings)
  • Search for
    Code:
    emmet.includeLanguages
  • Make sure it includes "PHP"
2. Configure IntelliSense for PHP
  • Install PHP IntelliSense extension
  • Enable HTML completions within PHP
3. Class completion issues,
  • Check
    Code:
    emmet.triggerExpansionOnTab
    or
    Code:
    emmet.triggerExpansionOnEnter
  • Install a CSS IntelliSense extension like "IntelliSense for CSS class names in HTML"
  • Install a CSS language support extension like "CSS Peek" or "IntelliSense for CSS, SCSS and Less"
 
It seems like you're encountering issues with Emmet abbreviation expansion and CSS styling within PHP files in Visual Studio Code. Here are some steps you can take to troubleshoot and potentially resolve these issues:

Code:
"emmet.includeLanguages": {
    "php": "html"
}
 
Back
Top