java - Mac Safari 不会运行大小为零的小程序

标签 java css macos safari applet

<applet> 中用 width=0 标记和 height=0小程序代码加载失败。我试图将 applet 放在一个隐藏的 div 中,但它还是无法加载 applet。现在我有一个解决方法,通过设置 width=1 来让它工作。和 height=1 .

有什么方法可以隐藏小程序并让它继续工作吗?

最佳答案

Is there any way to hide the applet and still get it to work?

是的,它通常出现在样式中。我预计您当前使用了错误的 CSS 来隐藏它。

不正确

display: none

This value causes an element to not appear in the formatting structure (i.e., in visual media the element generates no boxes and has no effect on layout). Descendant elements do not generate any boxes either; the element and its content are removed from the formatting structure entirely. ..

正确

visibility: hidden

The generated box is invisible (fully transparent, nothing is drawn), but still affects layout. Furthermore, descendants of the element will be visible if they have 'visibility: visible'.

关于java - Mac Safari 不会运行大小为零的小程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11740238/

相关文章:

Java : Operators and Typecasting

java.lang.ClassCastException(无法将类转换为同一个类)

css - bootstrap 4 行高

javascript - 如何禁用 slick 插件中的下一步按钮?

javascript - 用 Javascript 开发 native Linux/MacOSX 应用程序的工具?

macos - 在 Mac OS X 上使用 JP2 delegate 构建 ImageMagick

java - CMIS 浏览器网络应用程序

java - 避免在每个调用站点尝试/捕获,有利于单一位置

空格的 JavaScript 验证

macos - mac Swift 多个 keyDown 事件