PHP检查报告CSS选择器未使用。它被一个PHP回显标签使用 [英] PHP inspection reports CSS selector unused. It is used by a PHP echoed Tag

查看:103
本文介绍了PHP检查报告CSS选择器未使用。它被一个PHP回显标签使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有创建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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆