【问题标题】:Can using media query with CSS ::after & ::before tag?可以使用带有 CSS ::after 和 ::before 标签的媒体查询吗?
【发布时间】:2022-01-16 15:41:44
【问题描述】:

我使用 after 标记在定价表中显示自定义内容。它确实适用于桌面屏幕,但不显示在移动设备上。如何向其中添加媒体查询?

.wrc_pricing_table span.price_desc::after  
{
  content: "  year " !important;
  font-size:16px !important;
}
    }

【问题讨论】:

  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: css css-selectors media-queries


【解决方案1】:

@media screen and (max-width: 480px){
  .wrc_pricing_table span.price_desc::after  
{
  content: "  changed text " !important;
  font-size:14px !important;
}
    }
}

【讨论】:

  • 谢谢@aman。它在 WordPress 平台上工作吗?我将它用于 WordPress 网站。仍然没有在移动视图中显示内容?
  • 显然它适用于任何平台!您需要在您的网站上显示您尝试过的内容,可能还有其他原因,没有我们想象的图形表示。
猜你喜欢
  • 2022-01-14
  • 2011-04-06
  • 1970-01-01
  • 2017-07-08
  • 2012-12-17
  • 2019-03-17
  • 1970-01-01
  • 2011-10-27
相关资源
最近更新 更多