开发者

unwrap element does not copy dimensions to parent element

开发者 https://www.devze.com 2023-02-18 01:18 出处:网络
I\'m unwrapping an href around an image. The image has certain dimensions, the href has the dimensions taken from the image including the padding. When I perform the unwrap, the parent div doesn\'t ge

I'm unwrapping an href around an image. The image has certain dimensions, the href has the dimensions taken from the image including the padding. When I perform the unwrap, the parent div doesn't get 开发者_JAVA百科the dimensions from the new direct child (img) and the layout is screwed. What can I do?

regards, Jeroen


Make the parent a <span> and give it a display: block; property. This should adjust to the dimensions to what's inside it.

0

精彩评论

暂无评论...
验证码 换一张
取 消