- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi,
I have an image inside a paragraph p, and I do not intend to add code inside the function.php on WP to remove the wpautop filter.
Also is not working adding p img {margin: 0;} on css
Is there any way to force the image removes the space top and bottom that image have?
Thanks in advance.
I would think it is the p
element that needs the margin reset…
Shikkediel,
tks for reply,
I understand that, but doing that, will remove all margins from p, and I don´t want that.
I must target the <img without affect the parent element, I don´t know if existe any constructor selector to do that.
As far as I can tell, you’d still have to target the parent because that has the margin. There isn’t a CSS selector I am aware of to only address elements that contain a certain other element.
If you’d like to specifically target p
elements that contain an img
, you’d have to use JavaScript.
Shikkediel,
I think that you are right.
Maybe only with JS, but I have put a div without any class inside and automatically have removed the space.
Thank you.
I might not be familiar enough with WP to comprehend the mechanism you describe…
But if it works, then who’s complaining. :-)