PHP检查报告CSS选择器未使用。它被一个PHP回显标签使用 [英] PHP inspection reports CSS selector unused. It is used by a PHP echoed Tag
问题描述
我有创建HTML的PHP代码
I have PHP code which creates an HTML
echo('<div id="keyboard">');
在我的CSS中,
#keyboard {
}
PHPStorm报告CSS选择器未使用。它被使用。我能让它意识到吗?在没有的情况下,我曾经看到过禁用单个错误或警告的方法,但是我不能再在文档中找到它。
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.
推荐答案
您可以尝试的是将html移出php脚本,并在需要时打开括号。我怀疑IDE无法在PHP标签之外的PHP回显html和html之间进行区分。
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
?>
IDE现在应该能够将CSS与相关的id匹配。
The IDE should now be able to match the CSS with the relavant id.
这篇关于PHP检查报告CSS选择器未使用。它被一个PHP回显标签使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!