Facebook 应用程序中 iframe 中的填充错误
潜伏者的第一篇文章,所以请耐心等待。
在我公司的 Facebook 应用程序中,有一个可能包含错误消息的表单,该错误消息具有双左填充。它们有相当多的填充来与它们上方的输入对齐(也得到左侧填充)。
(损坏的错误消息img)http://img687.imageshack.us/img687/2609/ windows7x64ie9beta2.png
当我从 Facebook 中弹出同一页面时iframe,它正常显示,表单元素和错误消息排列在一起。
(未损坏的错误消息img)http://img535.imageshack.us/img535/ 651/windows7x64ie9beta14.png
实际代码是继承的(全部这个词的含义)混乱,但确实适用于所有内容,包括 IE6 和 IE6。 7、没有任何黑客行为。以下是这些 lis 上的所有非重置样式:
clear: none;
font-size: 12px;
margin-bottom: 0;
margin-top: 5px;
overflow: hidden;
padding-left: 160px;
我已经确认,加倍填充会产生混乱的视图(我只能在非混乱视图中使用 IE Developer 工具,因为它无法处理 iframe )。
有人有什么想法吗?除了撕掉旧代码并重新开始之外?
更新:似乎有必要删除旧代码。我有一些没有孩子的 UL,可能会造成一些损坏。
UPDATE 2:动态生成的dom很乱,但是这里的工程师没有时间重构它,所以我可能永远得不到这个问题的答案。 :(
First post from a lurker, so please bear with me.
In my company's Facebook app, there's a form that can have error messages, which are getting double left padding. They have a fair bit of padding to line up with the inputs above them (which also get the left padding).
(Broken error message img) http://img687.imageshack.us/img687/2609/windows7x64ie9beta2.png
When I pop this same page out of the Facebook iframe, it displays normally, with form elements and error messages lining up.
(Non-broken error message img) http://img535.imageshack.us/img535/651/windows7x64ie9beta14.png
The actual code is an inherited (in all senses of the word) mess, but does work in everything including IE6 & 7 with no hacks. Here are all of the non-reset-styles on these lis:
clear: none;
font-size: 12px;
margin-bottom: 0;
margin-top: 5px;
overflow: hidden;
padding-left: 160px;
I've confirmed that doubling the padding yields the messed up view (I can only use IE Developer tools in the non-messed up view since it can't handle the iframe).
Anyone have any idea? Other than ripping up this old code and starting over?
UPDATE: Seems like ripping up the old code might be a necessity. I have some ULs with no children that might be causing some breakage.
UPDATE 2: The dynamically generated dom is a mess, but the engineers here have no time to refactor it, so I may never get the answer to this question. :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能不是一个理想的解决方案,但我会使用一个条件和一个单独的仅 IE9 样式表来解决这个问题。
类似的事情:
在该样式表中可能会做这样的事情:
This may not be an ideal solution, but I would use a condition and a separate IE9-only stylesheet to fix this issue.
Something like:
and in that stylesheet maybe do something like this:
你用的是浮标吗?我通过类似的问题提出了这个问题。
看看这个答案:IE 9 CSS 浮动问题!
Are you using floats? I reached this question via a similar problem.
Check out this answer: IE 9 CSS Float problem!