【问题标题】:Magento 1.9 - How to add if - else condition in CSS?Magento 1.9 - 如何在 CSS 中添加 if - else 条件?
【发布时间】:2020-06-27 13:20:44
【问题描述】:

我只是想根据网站改变字体行为,如何在css中添加if-else条件。

我的 CSS :

td.email-heading h1 {
  font-weight: 700;
  font-size: 16px;
  margin: 1em 0;
  line-height: 20px;
  text-transform: uppercase;
}

如果网站 1 font-weight: 700 应该可以工作,如果网站 2 不应该工作。

【问题讨论】:

标签: css if-statement magento-1.9


【解决方案1】:

CSS 没有 IF,其他内置功能。您可以使用 JS jQuery 作为简单的替代品。

取决于需要满足什么条件(因为它没有在问题中指定)如果条件是屏幕尺寸,@media 可能是您的解决方案。 更多关于@media这里: https://www.w3schools.com/Css/css3_mediaqueries_ex.asp

【讨论】:

  • 我可以将 css 从 skin\frontend\base\default\css\email-inline.css 复制到 skin\frontend\default\theme\css\email-inline.css 并更改一些 css 效果吗推荐?
猜你喜欢
  • 2017-01-21
  • 2021-11-23
  • 2018-02-19
  • 2019-04-25
  • 1970-01-01
  • 2019-12-28
  • 2021-06-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多