- This topic has 10 replies, 3 voices, and was last updated 5 years, 5 months ago by
Dorian.
-
AuthorPosts
-
December 20, 2016 at 6:36 pm #256610
Dorian
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
I love coffee and blogging.
December 20, 2016 at 6:46 pm #256611Leo
StaffCustomer 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.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 20, 2016 at 7:38 pm #256614Dorian
Hi 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.
I love coffee and blogging.
December 20, 2016 at 8:01 pm #256617Leo
StaffCustomer 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.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 21, 2016 at 5:55 am #256722Dorian
That’s what I am using now, but
.entry-content a
includes all links including images. I end up with underlined pictures and buttons.I love coffee and blogging.
December 21, 2016 at 7:17 am #256737Leo
StaffCustomer SupportWhat if you try
.entry-content p > a
?Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 21, 2016 at 9:46 am #256792Dorian
I think that did it. Thanks so much Leo.
I love coffee and blogging.
December 21, 2016 at 10:19 am #256805Tom
Lead DeveloperLead DeveloperJust to add, that’ll apply to all links that are a direct child of a paragraph 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentDecember 21, 2016 at 3:10 pm #256897Dorian
Hi 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
I love coffee and blogging.
December 21, 2016 at 10:23 pm #256935Tom
Lead 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentDecember 22, 2016 at 12:16 pm #257147Dorian
Yeah that was my thinking as well. I’ll figure out something.
I love coffee and blogging.
-
AuthorPosts
- You must be logged in to reply to this topic.