Text outside div in Safari only

2019-07-22 00:58发布

问题:

I have this bug that let some text appear a few pixels outside a div on the right side. The strange thing is that it only happens in Safari. I've never seen it before and it's just regular HTML/CSS what I have used. I've looked around on the internet but I can't find the exact same problem - only some problems with content floating out at the bottom, because of a fixed height.

In the next 2 screenshots you'll see the same page in Safari and Chrome. The div has a overlow:hidden to hide a possible third line of text. I added fixed widths when trying to solve the problem. I also tried to add/remove some margins, but I can't get rid of the extra pixels.

Here is a full link to this page. It happens in this section of the website only. In other sections - like this one - where I use the same format with little differences, but the same CSS idea (fixed width with overflow:hidden), there is no bug in Safari.

I hope you have some ideas!

回答1:

Removing position:absolute from

div#branch-search-results-block div.search-result-right div.search-result-drvl-info-bottom .spacer::after

css style solves the issue. But I am not sure what else is affected by it. Please try this.



标签: html css safari