- This topic has 10 replies, 3 voices, and was last updated 7 years, 4 months ago by Dorian.
-
AuthorPosts
-
December 20, 2016 at 6:36 pm #256610Dorian
I am trying to style the a element, so that links look nicer and they are more enticing. Some of the links have a class, and with that class it’s really easy to style it. However most of the links don’t have a class, so I end up styling both text and images, which is not good.
My selector is .entry-content a which includes both text and images links.
Is there any way to style only the text?
My css would include border-bottom, color, background-color.Thank you,
Dorian
December 20, 2016 at 6:46 pm #256611LeoStaffCustomer SupportHi Dorian,
By any chance your site is live and we can see which links you are talking about?
You can also give the text links you inserted a specific class and target your CSS to that class as well.
Let me know.December 20, 2016 at 7:38 pm #256614DorianHi Leo,
Thanks for helping with this.
The site is live. Here is a page: http://coffee-brewing-methods.com/espresso-coffee-maker/domestic-cappuccino-maker/
Note the difference between the links in the page, styled vs not styled. The styled ones have a class, so I can target them properly. THose are created using a plugin. The manually created links don’t have any class.There are too many links on the website to change the class for all of them.
December 20, 2016 at 8:01 pm #256617LeoStaffCustomer SupportI”m assuming the links in red are the ones you want to style?
If so give this selector a shot?.entry-content a
Let me know.December 21, 2016 at 5:55 am #256722DorianThat’s what I am using now, but
.entry-content a
includes all links including images. I end up with underlined pictures and buttons.December 21, 2016 at 7:17 am #256737LeoStaffCustomer SupportWhat if you try
.entry-content p > a
?December 21, 2016 at 9:46 am #256792DorianI think that did it. Thanks so much Leo.
December 21, 2016 at 10:19 am #256805TomLead DeveloperLead DeveloperJust to add, that’ll apply to all links that are a direct child of a paragraph 🙂
December 21, 2016 at 3:10 pm #256897DorianHi Tom,
Yes I discovered that linked images within paragraphs get the styling too. I can apply a class to the link with the image. I am looking at a way to do that automatically. If you guys have an idea, it would be awesome. As is is not too bad, if people hover with the mouse on images they’ll see my oversized background for a:hover.
Such as the infographic on this page: http://coffee-brewing-methods.com/super-automatic-espresso-machine-reviews/Cheers,
Dorian
December 21, 2016 at 10:23 pm #256935TomLead DeveloperLead DeveloperHmm, not sure of a way to do it automatically I’m afraid, although you might find a function out there that will do it.
If most links need the styling, then applying a class to ignore it to other elements is the best bet. If only some links need the styling, applying a class to apply it to those links would be best.
December 22, 2016 at 12:16 pm #257147DorianYeah that was my thinking as well. I’ll figure out something.
-
AuthorPosts
- You must be logged in to reply to this topic.