donglaohua1671 2016-03-21 04:18
浏览 54
已采纳

在HTML中自定义CSS

I've got a Wordpress site using WooCommerce, and I've got a plugin that isn't working how it should. So, I managed to find a particular line in the PHP code that triggers when I need it to do something my way. Problem is, I need to change some CSS styling within the PHP code.

How exactly would one do something like this?

<woocommerce class="a.button.alt"><style>background: #FF8282; pointer-events: none;</style></h1>
<woocommerce class="button.button.alt"><style>background: #FF8282; pointer-events: none;</style></h1>

Mind you that code above is incorrect. It is just an example of what I'm trying to achieve.

As for a more detailed breakdown, I'm trying to change/override a CSS style that already exists on my web page. Overall, the trick is to change some CSS style that already exists into doing something else. The CSS for the item I found (from Firefox's HTML debugger/inspector) is:

.woocommerce #respond input#submit.alt, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt

And I need it to apply these styles instead:

background: #FF8282;
pointer-events: none;

If you need more information, just let me know.

Thank you.

  • 写回答

4条回答 默认 最新

  • dousong4777 2016-03-21 07:57
    关注

    SOLVED

    I included in the logic that was tripping some PHP code:

    include '/wp-content/themes/my_theme/400.css';
    

    And that CSS file (400.css) contained:

    <style>
        .woocommerce a.button.alt { background: #FF8282 !important; pointer-events: none !important; }
    </style>
    

    Thank you everyone for your help. Much appreciated.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改