- This topic has 12 replies, 3 voices, and was last updated 7 years, 3 months ago by
David.
-
AuthorPosts
-
November 5, 2018 at 5:02 pm #719945
David
Hi all,
Here is a snippet of css form my child style.css
How can I prevent this dotted line from showing up below linked images? I would prefer there be no indication it’s clickable (other than the standard mouse hover which changes the cursor)
Thanks for any help. 🙂
/*
Dotted Underline Links Custom Class
*/
.entry-content a, .entry-content a:visited, .entry-content a:active {
text-decoration: none;
color: #0099ff;
border-bottom: 1px dotted;
}
.entry-content a:hover {
text-decoration: none;
color: #474747;
border-bottom: 1px dotted;
}November 5, 2018 at 5:31 pm #719957Tom
Lead DeveloperLead DeveloperYou can give the link surrounding an image a class like this:
no-link-border<a href="#" class="no-link-border"><img src="..." /></a>Then you can add this CSS:
.entry-content a.no-link-border { border: 0; }November 5, 2018 at 5:52 pm #719963David
Hey tom,
is there anyway to do it for all images without a class considering I’d never want it to occur?
I only ask because some images are from amazon.
November 5, 2018 at 6:34 pm #719978Tom
Lead DeveloperLead DeveloperUnfortunately you can’t target an element depending on what’s inside of it (without javascript).
For links to Amazon, you could try this:
.entry-content a[href*="amazon.com"] { }November 6, 2018 at 6:57 am #720441David
Ahh I see. I’ll give that a shot.
Would you by chance have any idea why Gutenberg would show an image centered in the editor but still align left when published?
I did some searching and all I could find was that it was a known issue that has since been resolved – or that it was a conflict with theme (which I find hard to believe)?
Just figured I’d see if you’ve heard/ran across that before.
Thanks Tom!
November 6, 2018 at 7:25 am #720459David
Just an update to my first question and my followup question:
The problem is the Gutenberg image block. For both the underline issue and the non-centering issue. If I create a custom editor block and add the HTML for the image from Amazon, I can then center it and when previewed it shows centered without the line beneath it.
Weird. I have no idea why it occurs with the image block but that was the problem for anyone else that may experience it in future.
Thanks again Tom. 🙂
November 6, 2018 at 8:29 am #720517Tom
Lead DeveloperLead DeveloperNo problem! Thanks for letting us know 🙂
December 5, 2018 at 8:00 am #748827David
Hi again Tom,
Since updating Gutenberg and GP, I still have this problem.
Interestingly enough, if I align-left in the image block it shows left when I preview. If I align-center and preview it still shows to the left. But if I align-right and preview, it is to the right! It’s only the center that won’t change when previewed or published.
Do you have other insight as to why this is occuring? I’d much rather use the image block then the classic block… so much more convenient.
December 5, 2018 at 6:04 pm #749260Tom
Lead DeveloperLead DeveloperCan you write out some step by step instructions so I can try to reproduce the issue?
Let me know 🙂
December 7, 2018 at 7:15 pm #751140David
Hi Tom,
I just add a new image block, add the image, center it (which shows centered in gutenberg editor) and then preview (or publish) and it still shows aligned to the left…
**NOTE: I added a link to the original post so you could see an image that shows to the left but when you view the source it shows “aligncenter is-resized”.
December 8, 2018 at 5:08 am #751335David
StaffCustomer SupportHi there,
Elementor is adding this CSS which is stripping out the left / right margins used to center the block:
.elementor .elementor-widget:not(.elementor-widget-text-editor) figure { margin: 0; }I would raise this with Elementor as to why they are doing it this way. In the meantime you can get all !important and add this CSS:
.wp-block-image .aligncenter { margin-left: auto !important; margin-right: auto !important; }December 8, 2018 at 4:09 pm #751708David
Oh my gosh! David, thank you! I have been dealing with this for weeks, pulling my hair out and relying on the classic editor block just to center my images.
I really, really appreciate you helping me get to the bottom of this! That CSS worked great!
I will be emailing Elementor customer support to bring this to their attention right now.
Thank you again!
David
December 9, 2018 at 2:20 am #751881David
StaffCustomer SupportYou’re welcome. Glad we could be of help.
-
AuthorPosts
- You must be logged in to reply to this topic.