You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WordPress Elementor表单提交按钮颜色样式不一致问题求助

Fixing Dull :active/:focus Button Colors in Elementor + OceanWP

Hey Mike, that tiny but frustrating button styling quirk is definitely something we can squash quickly! The issue is almost certainly that either OceanWP’s default styles or Elementor’s base button CSS is adding an opacity overlay, filter, or lower-priority color rule that’s dimming your custom :active/:focus states.

Here’s how to fix it:

  • First, use your browser’s DevTools (hit F12, then inspect the button while it’s in :active or :focus state) to check if there’s an opacity property set to something less than 1, or a filter like grayscale() or brightness() that’s toning down the color. That’ll tell you exactly what to override.

  • Then, add this targeted custom CSS to your site (either via Elementor’s Custom CSS panel for the button, or OceanWP’s Customizer > Additional CSS):

/* Force bright colors for button active/focus states */
.elementor-button:active,
.elementor-button:focus {
    background-color: #ff4d4d !important; /* Replace with your desired bright color */
    border-color: #ff4d4d !important;
    opacity: 1 !important; /* Remove any dimming opacity */
    filter: none !important; /* Clear any default filters */
    box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.5) !important; /* Optional: Add a focus ring if needed */
}

The !important flags here ensure your custom styles take priority over the theme/builder’s default rules. If you don’t want to use !important, you can make your selector more specific—for example, if your button is inside a section with a specific ID, use #your-section-id .elementor-button:active instead.

Another thing to check: Make sure you’re targeting the correct button class. Some Elementor buttons might use elementor-button-link instead of elementor-button, so adjust the selector if needed based on what you see in DevTools.

That should make those button states pop exactly how you want them!

内容的提问来源于stack exchange,提问作者Mike Peiman

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:23:30