为什么 default_head_blocks.xml 不删除 css 文件?
why is default_head_blocks.xml not removing the css files?
我在里面放了 2 个删除标签 default_head_blocks.xml
:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<remove src="css/print.css"/>
<remove src="css/styles-m.css"/>
</head>
</page>
文件在app/design/frontend/<theme>/Magento_Theme/layout/
下
但是 css 文件没有被删除。我应该把文件放在不同的目录吗?
目录正确。能否请您尝试刷新缓存并再次检查。
我在里面放了 2 个删除标签 default_head_blocks.xml
:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<remove src="css/print.css"/>
<remove src="css/styles-m.css"/>
</head>
</page>
文件在app/design/frontend/<theme>/Magento_Theme/layout/
但是 css 文件没有被删除。我应该把文件放在不同的目录吗?
目录正确。能否请您尝试刷新缓存并再次检查。