How to change the link color in a custom news ticker widget to white or another color
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2023 04:06 PM
Hi,
I created a custom news ticker with black background and white letter. However, when you try to do a mouse over on the link, it turns dark blue. This makes the ticker unreadable. Is there a way to change the hover color? It seemed that it is picking up the default css from the theme. As a workaround I moved the content of the ticker out of <a></a> and put there "See details" which still changes its color to dark blue. I actually plan to copy the announcement widget to handle the ticker but because of time constraint, I was forced to just implement the news ticker like this. Here is the part of the css I used/experimented for the ticker:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2023 07:08 AM
Hi,
I would suggest to check things like this:
- you say you have a custome widget, so you can alter your code and css in that widget. Check first if the styling used is used in a another widget, page stylesheet or theme. Meaning: the css that you showed above, if like you guess the theme is also setting same elements with the same rules then the theme will overrule. You cna give more priority on your css in the widget with adding "!important". So:
a hover on a link like for instance a:hover{ color:#ffffff;} will become a:hover{ color:#ffffff !important;} That should immediately solve your issue - If not solved try to change your code in the widget to make it specific so other css rules don't affect your code, like for instance if your anchor link has now a class ".news-ticker-h", change something like:
<a class=".news-ticker-h"> to something like <a class=".news-ticker-h my-new-extra-class"> and then set in your css a rule on the new class:
a.my-new-extra-class:hover { color:white; }
Thanks in advance! Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2023 01:40 AM
Thank you. Here is the HTML.