如何让文本/对象保留在 div 元素中? (让 div “拉伸”,这样所有内容都会留在里面?)
使用 Internet Explorer,当我对 jQuery(幻灯片)或 YouTube 视频或带有 oembed 的内容产生效果时,它会重叠或溢出下面的文本/内容。我怎样才能拥有它,以便 div 将“拉伸,以便所有文本或视频都保留在元素内?
With Internet Explorer when I have an effect with jQuery (slidedown) or a youtube video or something with oembed it will overlap or overflow over the text/content below. How can I have it so the div will "stretch so all of the text or video will stay inside the element?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试在
Try clearing floats explicitly after the
<object>
. Something like this:我正在查看生成的 DOM,对于 Firefox 来说非常混乱,与 Chrome 生成的完全不同。我怀疑 JavaScript 的弯曲角,我建议将其排除在外以进行确认,然后与开发人员联系。
I was looking at the generated DOM which is quite messy for Firefox and nothing like what's generated for Chrome. I suspect the curvy corners JavaScript and I'd suggest getting that out of the picture to confirm and then taking it up with the developer.
Internet Explorer 7 更喜欢某些具有“容器”的元素,我不太清楚为什么,但我在尝试在 IE7 中设置透明 PNG 不透明度动画时遇到了这个问题。
在
Dream.html
内 Flash 对象(您的视频):周围应该有一个
div
,类似于:您不必给它一个
id
但保持事物相当语义化是很好的 - 而且就像评论一样您的代码,当您返回时会很有帮助。。 。 。
我测试了这个,它可以在 IE7/IE8 中运行。
Internet Explorer 7 prefers certain elements have 'containers,' I'm not entirely sure why--but I've ran into the issue while trying to animate transparent PNG opacity in IE7.
Inside
Dream.html
the flash object (your video):<object width="395" height="321">.. .. ..</object>
Should have a
div
around it, something like:You don't have to give it an
id
but it's nice to keep things fairly semantic--plus just like commenting your code, it's a helpful when coming back to it.. . .
I tested this, and it works in IE7/IE8.