PHP检查报告CSS选择器未使用。 它由PHP回显标签使用

I have PHP code which creates an HTML

echo('<div id="keyboard">');

In my CSS I have

#keyboard {
}

PHPStorm reports the CSS selector is not used. It is used. Can I make it realize that? In not, I once saw some way of disabling a single error or warning, but I can no longer find that in the documentation.

What you can try is to move the html out of the php script and just open the parentheses when needed. I suspect that the IDE cannot distiguish between php echoed html and html outside of php tags.

<?php
 //add php code here
?>
<div id="keyboard">
<?php
 //php code here
?>
</div>
<?php
 //add php code here
?>

The IDE should now be able to match the CSS with the relavant id.