标题不显示在浮动元素之前

发布于 2024-07-09 14:18:55 字数 229 浏览 6 评论 0原文

在页面 http://tesselaar.com/gallery/ 上,我有一个标题(级别 1)页面顶部的“照片库”在 IE7 中不显示,我不知道为什么。

它遵循与网站其余部分相同的 CSS 和页面结构,唯一的区别是有一个元素立即浮动到右侧。

任何见解将不胜感激。

On the page http://tesselaar.com/gallery/ I have a heading (level 1) at the top of the page "Photo Gallery" that doesn't display in IE7 and I can't work out why.

It follows the same CSS and page-structure as the rest of the site, the only difference being there is an element being floated to the right immediately after.

Any insight would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迷荒 2024-07-16 14:18:55

对我来说,这确实有点问题,但由于这里只安装了 IE 开发工具,我可以说这不是 HTML 本身,它绝对是 IE CSS 错误。 IE 的众多问题之一就是浮动,因此在此基础上我建议您尝试两件事。

第一个是将文档类型更改为严格 - 这是一个更坚实的基础,并将改变 IE 的行为方式。 可能会自行修复。

第二个建议是删除 div 中的浮动和宽度,而是依赖于您应用于表单的 text-align: right; 。 这将为您提供与 FF 中现在显示的布局相同的布局,而无需使用浮动。 然而,您可能想要实现的是紧邻标题右侧的浮动下拉列表? 如果你想保持居中的标题,那将会非常混乱。

It certainly appears glitchy to me, but with only IE dev tools installed here I can say it isn't the HTML in itself, it's definitely an IE CSS bug. One of the many many things IE is twitchy about is float, so on that basis I suggest you try two things.

The first is to change the doctype to strict - it's a more solid base to go forward from and will change the way IE behaves. Might fix it in itself.

The second suggestion is to remove the float and width from the div and instead rely on the text-align: right; you have applied to the form. That would give you the same layout as appears in FF now without the use of float. However it appearsthat what you might be trying to achieve is a floating dropdown directly next and right of the header? If you want to keep a centered header that's going to be pretty messy tbh.

临风闻羌笛 2024-07-16 14:18:55

我怀疑问题与浮动和斜体内容有关。 IE 讨厌让斜体内容围绕浮动。

我怀疑当你收紧其他一些CSS时,你在那里隐藏了一些溢出并无意中修复了两个问题......

这是一篇关于它的不错的小文章: http://www.positioniseverything.net/explorer/italicbug-ie.html

I suspect that the issue was to do with floats and italicized content. IE hates having italicized content wrapping around floats.

I suspect that as you were tightening up some other css you put some overflow hidden in there and inadvertently fixed two problems...

Here's a nice little article about it: http://www.positioniseverything.net/explorer/italicbug-ie.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文