Opera 中的表单元素不遵守 CSS 垂直对齐方式
我已在导航栏内插入了 Google 自定义搜索引擎表单,但我无法使其在 Opera 中居中对齐。所有浏览器都完美地遵循垂直对齐(是的!甚至 IE..哇!)。
您可以在 www.micod.cat 上查看(该网站不是英文的,但您可以轻松查看搜索框在菜单栏中,右侧)。 Opera 将表单输入字段推到顶部,这是不正确的。
这是该元素的 CSS:
#menu li.find form div {
padding: 0;
margin: 0;
height: 50px;
line-height: 50px;
vertical-align: middle;
}
请有聪明人提供一些见解吗?多谢!
I've inserted a Google Custom Search Engine form inside of a navigation bar but I just can't get it to center align in Opera. All browsers are respecting the vertical alignment perfectly (yes! even IE.. wow!).
You can check it out at www.micod.cat (the site's not in English but you can easily view the Search box in the menu bar, right). Opera is pushing the form input field flush against the top and that's incorrect.
Here's the CSS for that element:
#menu li.find form div {
padding: 0;
margin: 0;
height: 50px;
line-height: 50px;
vertical-align: middle;
}
Any bright minds to offer some insight please? Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
问题是 Doctype,将其更改为严格的 Doctype 或 HTML 类型即可修复它,例如
XHTML 过渡 Doctype 意味着 Opera 以“几乎标准”模式呈现,尽管我不知道为什么这会影响这一点,- Opera Doctype 开关
The problem is the Doctype, changing it to a strict one or an HTML one fixes it e.g.
The XHTML transitional Doctype means Opera renders in "Almost Standards" mode, though quite why that would affect this I don't know, - Opera Doctype Switches
我不知道为什么,也不知道发生了什么,但在
可以修复它。
之前放置一个
您应该等待更好的答案,但如果没有到达,至少这可行。
I don't know why, or what's going on, but placing an
before
<input type="q" .. />
fixes it.You should wait for a better answer, but if one doesn't arrive, at least this works.
它不是您要对齐的内容,而是内容内的图像。
并查看您的网站,您需要:
It isn't the content you want to align, but the image inside the content.
and looking at your site you'll need: