我正在使用表格创建一个 CSS 按钮。该按钮在 Firefox 和 IE(怪异模式)中工作正常。不幸的是,Safari 的怪异模式存在问题。
首先是一点背景知识..这是一个api按钮,即这个按钮可以用在我无法控制的各种地方..所以用float: left之类的东西解决问题并没有真正起作用。我几乎在我能想象到的所有场景中都对此进行了测试,这是最后一个问题原因。
我正在测试的场景是一个表,其中一列具有align =“center”。我无法控制它,所以请不要建议更改该部分。只有按钮和 css 是我可以控制的.. 即以 开头的部分
这里的主要问题是在 Safari 中按钮占据了整个其父级的宽度,这会导致其旁边的按钮被强制到下一行。我需要按钮像在 IE 和 Firefox 中一样显示。
此外,这必须在 IE、Firefox 和 Safari 中工作,并且它不能包含 DOCTYPE 标记以使其脱离怪异模式。
这是工作示例:
点击我!
有关为什么这些表格按钮占据整个宽度的任何帮助父桌将非常非常感谢。
I am creating a css button using a table. The button is working fine in Firefox and IE (quirks mode). Unfortunately there is an issue with Safari's quirks mode.
First a little background.. This is a button for an api, i.e. this button may be used in all sorts of places that I can't control.. so fixing the problem with things like float: left don't really work. I've tested this in just about every scenario I can imagine, this is the last problem-causer.
The scenario I'm testing this in is a table where a column has align="center".. I can't control that so please don't suggest to change that part. Only the buttons and css are things I can control.. i.e. the part that begins with <table cellpadding="0px"...
The main problem here is that in Safari the button takes up the entire width of its parent, which causes the button next to it to be forced onto the next line. I need the buttons to appear just as they do in IE and Firefox.
Also, this has to work in IE, Firefox, and Safari and it can't contain a DOCTYPE tag to take it out of quirks mode.
Here is the working example:
Click me!
Any help on why these table buttons are taking up the entire width of the parent table would be very very very much appreciated.
发布评论
评论(1)
由于 Quirks 模式样式表,表格按钮占据了父表格的整个宽度:
使用 CSS filter 为 Safari 指定浏览器特定的例外。
参考资料
The table button is taking up the entire width of the parent table due to the Quirks mode stylesheet:
Use a CSS filter to make a browser specific exception for Safari.
References