- This topic has 11 replies, 4 voices, and was last updated 2 years, 5 months ago by
Ying.
-
AuthorPosts
-
July 11, 2020 at 1:54 am #1359817
nudnavda
Sorry if I steal your time, but I’ve been searching for some hours now – without result.
I’m looking for the css-code to prevent background color appearing on two image links on a specific page (see url beneath). The paragraph code containing the two images:<p><a href="https://twitter.com/dharmoebe/" target="_blank" rel="noopener noreferrer"><img src="http://www.gedel.nl/wp-content/uploads/2020/05/twitter-vogel.png" alt="" width="34" /></a> <a href="https://instagram.com/dharmoebe/" target="_blank" rel="noopener noreferrer"><img src="http://www.gedel.nl/wp-content/uploads/2020/05/Instagram-icoon.png" alt="" width="33" height="33" /></a></p>
In extra css I put:
.page-id-4527 a:hover img {background-color: transparent}This noob can’t get it to work, unfortunately.
Thanks for any help!July 11, 2020 at 10:56 am #1360272Leo
StaffCustomer SupportHi there,
You will need add a custom class like
no-background-color
to the social icons links first.Then I can provide the CSS 🙂
July 11, 2020 at 11:21 pm #1360603nudnavda
Thanks, Leo, for the fast reply!
Here’s the code with class added:<p><a href="https://twitter.com/dharmoebe/" target="_blank" rel="noopener noreferrer" class="no-background-color"><img src="http://www.gedel.nl/wp-content/uploads/2020/05/twitter-vogel.png" alt="" class="wp-image-7083" width="34"></a> <a href="https://instagram.com/dharmoebe/" target="_blank" rel="noopener noreferrer" class="no-background-color"><img src="http://www.gedel.nl/wp-content/uploads/2020/05/Instagram-icoon.png" alt="" class="wp-image-7082" width="33" height="33"></a></p>
Greetings,
adJuly 12, 2020 at 9:54 am #1361092Leo
StaffCustomer SupportThe wrong quotation mark is being used here.
Make sure it’s
class="no-background-color"
.July 12, 2020 at 10:56 pm #1361488nudnavda
Mm, I opened source view in Chrome to check.
Both instances – my quote and yours – appear to have the same contents:
"no-background-color"Also, I convert all copied text standard to plain text via PureText application (shortcut).
Very curious to hear more details on this 😉July 13, 2020 at 2:29 am #1361641David
StaffCustomer SupportHi there,
this is how your HTML should look:
<p> <a href="https://twitter.com/dharmoebe/" target="_blank" rel="noopener noreferrer" class="no-background-color"> <img src="https://www.gedel.nl/wp-content/uploads/2020/05/twitter-vogel.png" alt="" class="wp-image-7083" width="34"> </a> <a href="https://instagram.com/dharmoebe/" target="_blank" rel="noopener noreferrer" class="no-background-color"> <img src="https://www.gedel.nl/wp-content/uploads/2020/05/Instagram-icoon.png" alt="" class="wp-image-7082" width="33" height="33"> </a> </p>
Then use his CSS to remove the color:
.inside-article a.no-background-color:hover { background-color: transparent; }
July 13, 2020 at 2:48 am #1361661nudnavda
Perfect – thanks for your help!
July 13, 2020 at 3:21 am #1361693David
StaffCustomer SupportYou’re welcome
April 9, 2023 at 3:04 am #2602779nudnavda
Hi David,
on the page
https://www.gedel.nl/blog/zeg-een-gedicht-van-rumi/
appears the same issue as solved (years ago) in this topic:
hovering over the image gives a brown background beneath.The standard css is:
.inside-article a:hover {
text-decoration-line: none;
background-color: #9d835e;
color: white;}There no effect when I add:
.inside-article a.no-background-color:hover {
background-color: transparent;}Maybe it’s conclicting with the standard rule?
I tried to use !important…Would you know how to solve this?
Btw, is there a general way to prevent hover-effects on images?Thanks for any help.
April 9, 2023 at 12:11 pm #2603309Ying
StaffCustomer SupportHi there,
.inside-article a.no-background-color:hover { background-color: transparent;}
When using the above CSS, you need to make sure the
<a>
element has theno-background-color
class.I just inspected your page and I don’t see this class being applied to any
<a>
elements.April 9, 2023 at 11:32 pm #2603622nudnavda
Thanks, Ying – this solved the problem.
After first adding in Customizer / Extra css:
.inside-article a.no-background-color:hover {
background-color: transparent;}I had to add class=”no-background-color” to the
<a>
-element in the html of the block (not in the Extra css-classes of the Advanced section in the right side-bar).All the best to you!
April 10, 2023 at 3:30 pm #2604663Ying
StaffCustomer SupportGald that you’ve solved the problem 🙂
Good job!
-
AuthorPosts
- You must be logged in to reply to this topic.