【发布时间】:2011-06-03 09:29:38
【问题描述】:
我正在尝试为工具提示创建一个纯 CSS 三角形。除了最新的 Firefox 4 之外,所有浏览器看起来都很好。代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Untitled Document</title>
<style>
.arrow {
border:50px solid;
border-color:#eee transparent transparent transparent;
display:block;
height:0;
width:0;
top:50%;
right:50%;
position:absolute;
}
</style>
</head>
<body>
<div style="border:1px solid #000; height:400px; width:400px; margin:50px auto; position:relative;">
<span class="arrow"></span>
</div>
</body>
</html>
Firefox 4 屏幕截图:
其他浏览器截图:
正如您在 Firefox 4 中看到的那样,它有类似边框的东西。是 Firefox 的错误还是真的是这种行为?
如何在 FF4 中实现没有可见边框的纯 CSS 三角形?另外,我需要其他 3 种颜色是透明的,因为这个三角形会重叠一些元素。
【问题讨论】:
-
我正在使用 FF4,但我没有得到你描述的这种奇怪的行为。你没有使用 FF4 Beta 什么的?
-
我无法重现这个。使用Firefox 4/Windows 7,没有“边框”,看起来和其他浏览器一样。
-
我在 Windows 7 中使用 Firefox 4.0.1,我也在 Windows XP FF 4.0.1 中尝试过
-
如果使用红色等深色,则边框不可见。但如果使用#eee等浅色,则非常显眼。
标签: css transparent firefox4