在 magento 的 CMS 页面中使用静态块时没有 CSS
我有一个静态块作为主题的一部分,可以在主页上完美运行 - 但是当我将静态块添加到任何其他页面时,它会以不同的方式显示。基本上,CSS 不遵循块,而且看起来也不像应有的那样。该块包含主题提供的小部件,那么我是否正确地说创建小部件时应附加 CSS?
有没有办法强制 CSS 遵循块而不用过多地摆弄核心文件?或者有人能看到我忽略的东西吗?
I have a static block as part of a theme that works perfectly on the homepage - but when I add the static block to any other page it displays differently. Basically the CSS doesn't follow the block and it looks nothing like it should. The block contains a widget provided by the theme, so am I correct saying the CSS should be attached when the widget is created?
Is there anyway to force the CSS to follow the block without fiddling too much with the core files? Or can anyone see something I am overlooking?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能强制 CSS “跟随”该块 - 您能做的最好的事情就是确保所需的 CSS 已加载到您想要的页面上。
您有几个选择:
你是对的,最好避免摆弄 Magento 的核心文件,但你应该能够只编辑主题文件,这些文件不被视为核心代码,并且想必你已经这样做了以自定义外观。
You can't force the CSS to 'follow' the block - the best you can do is make sure the required CSS is loaded on the pages you want.
You have a few options:
You're right that it's best to avoid fiddling with Magento's core files, but you should be able to just edit your theme files, which aren't considered core code, and presumably you have done this anyway to customise the appearance.