Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1416631
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionI would like to have a transparent nav bar. On the landing page, there will be a slider with images of varying colors, so I would like to change the text color of menu items to contrast against each respective image.
A solution I found here seemed ideal:
However, when I implement here in an HTML builder: , it outputs a totally different effect. Same code, same browser, so I'm assuming it's Wordpress?
mix-blend-mode: difference
also seems to have no effect when I've applied it to other selectors from the stylesheet. Is there a reason WP won't output the same as the codepen?
I would love a pure CSS solution if possible. JS as a last resort is doable, but not preferable. I have found SASS solutions, but have no idea what to do with that.
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionI would like to have a transparent nav bar. On the landing page, there will be a slider with images of varying colors, so I would like to change the text color of menu items to contrast against each respective image.
A solution I found here seemed ideal: https://codepen.io/thebabydino/pen/bWWwGa
However, when I implement here in an HTML builder: https://cutt.ly/KwyC2av, it outputs a totally different effect. Same code, same browser, so I'm assuming it's Wordpress?
mix-blend-mode: difference
also seems to have no effect when I've applied it to other selectors from the stylesheet. Is there a reason WP won't output the same as the codepen?
I would love a pure CSS solution if possible. JS as a last resort is doable, but not preferable. I have found SASS solutions, but have no idea what to do with that.
Share Improve this question asked Aug 9, 2019 at 20:21 hedgehogsweaterhedgehogsweater 53 bronze badges1 Answer
Reset to default 1If you inspect the text, you'll see that your theme's CSS is overriding your custom CSS.
You have h2 { color: white; }
but your theme has .widget h2 { color: inherit; }
so "inherit" wins out. If you change your own CSS to
.widget h2 { color: white; }
it will override the theme. Incidentally, the markup here is quite overly complex; you might want to look into a simpler theme without quite so many nested divs.
本文标签: cssChange text color dynamically in Wordpress
版权声明:本文标题:css - Change text color dynamically in Wordpress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745254605a2650025.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论