- This topic has 13 replies, 2 voices, and was last updated 1 year, 5 months ago by David.
-
AuthorPosts
-
November 23, 2022 at 3:33 am #2428744Paul
Hi There,
I added a class to links within paragraphs and list items (see below). The problem is the li also effects the nav and sub-nav – do you know if I can just target links within li items within the content (not nav items)? There is also an example link in the private info.
Thanks
p a {
box-shadow: 0px -1px 0px var(–bluedark-300) inset;
transition: all 0.3s ease 0s;
padding: 2px;
}p a:hover {
box-shadow: 0px -4px 0px var(–bluedark-300) inset;
}li a {
box-shadow: 0px -1px 0px var(–bluedark-300) inset;
transition: all 0.3s ease 0s;
padding: 2px;
}li a:hover {
box-shadow: 0px -4px 0px var(–bluedark-300) inset;
}November 23, 2022 at 4:59 am #2428873DavidStaffCustomer SupportHi there,
your post content is output inside a div with the
entry-content
class. So you can use that in your CSS Selector like so:.entry-content :is(p, li) a { box-shadow: 0px -1px 0px var(–bluedark-300) inset; transition: all 0.3s ease 0s; padding: 2px; } .entry-content :is(p, li) a:hover { box-shadow: 0px -4px 0px var(–bluedark-300) inset; }
As the CSS Rule for your
p
andli
had the same properties i also combined them using the:is
pseudo selector.November 23, 2022 at 6:06 am #2428969PaulThank you David! Much appreciated as always.
November 23, 2022 at 6:13 am #2428978PaulHi David,
I just tried using that CSS but removes all link styles in the content?
Cheers
PaulNovember 23, 2022 at 6:59 am #2429049DavidStaffCustomer SupportCan i see a link to a page where the link styles are missing ?
November 23, 2022 at 7:08 am #2429056DavidStaffCustomer SupportTry:
.entry-content p a, .entry-content li a { box-shadow: 0px -1px 0px var(–bluedark-300) inset; transition: all 0.3s ease 0s; padding: 2px; } .entry-content p a:hover, .entry-content li a:hover { box-shadow: 0px -4px 0px var(–bluedark-300) inset; }
November 23, 2022 at 8:00 am #2429363PaulJust tried that and still don’t see the link styles (link to example page in private info)
Thanks
November 23, 2022 at 8:27 am #2429428DavidStaffCustomer SupportOk, try this:
.dynamic-entry-content :is(p, li) a { box-shadow: 0px -1px 0px var(--bluedark-300) inset; transition: all 0.3s ease 0s; padding: 2px; } .dynamic-entry-content :is(p, li) a:hover { box-shadow: 0px -4px 0px var(--bluedark-300) inset; }
As you’re using a Block Element content template we need to use:
dynamic-entry-content
And the other issue was the double hyphen invar(--bluedark-300)
was getting swapped out for a long hyphen.
If it still plays up re-type the two hyphens.November 24, 2022 at 3:00 am #2430682PaulHi David,
Thank you for persisting with this and sorry to be a pain!
Just tried it and still not working for me I also tried replacing the var(–bluedark-300) with a # colour to rule that as the issue.
Cheers
PaulNovember 24, 2022 at 3:32 am #2430742DavidStaffCustomer SupportHave you tried clearing your browser caches ? As i can see the styles
November 24, 2022 at 4:18 am #2430816PaulAhhh can see them now – thanks you, need more coffee 🙂
Is there anyway those link styles also display in the sidebar on the post page (see link in private info)?
Ideally would like links also in pages body content to use the same style so for example (link in private info).
November 24, 2022 at 4:25 am #2430821DavidStaffCustomer SupportTry this instead:
#page :is(p, li) a { box-shadow: 0px -1px 0px var(--bluedark-300) inset; transition: all 0.3s ease 0s; padding: 2px; } #page :is(p, li) a:hover { box-shadow: 0px -4px 0px var(--bluedark-300) inset; }
November 24, 2022 at 5:41 am #2430944PaulPerfect! Thank you David and have a great day!
Paul
November 24, 2022 at 6:03 am #2430974DavidStaffCustomer SupportGlad to be of help – you too
-
AuthorPosts
- You must be logged in to reply to this topic.