- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
如本例所示 https://jsfiddle.net/xozytmbv/5/有一个奇怪的 1px 深色边框(我假设背景是 #nav
元素。最初它存在于所有浏览器中。
我通过添加 translateZ(1px)
找到了 Firefox 的解决方案,如下所示 Unwanted outline on border when parent is transformed但它不适用于 Chrome 或 Edge。
#nav {
background-color: #183650;
overflow: hidden;
}
ul {
margin: 0 auto;
width: 100%;
display: flex;
justify-content: center;
align-content: center;
}
li {
padding: 9px 0;
list-style: none;
}
li.last,
li.first {
background: none transparent;
position: relative;
}
li.last::after {
content: "";
position: absolute;
top: 0;
left: 100%;
width: 1000px;
height: 100%;
background-color: #20bef2;
}
li a {
border: none;
color: #FFF;
text-transform: uppercase;
font-size: 17px;
letter-spacing: 1px;
padding: 0.75em 0.7em;
}
li.last {
background-color: #20bef2;
border-left: 3px solid #FFF;
}
li a {
text-decoration: none;
}
li a:hover {
background: none transparent;
}
li:last-child {
background-color: #20bef2;
transform: translateZ(1px) skew(-15deg);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
li:last-child a {
transform: translateZ(1px) skew(15deg);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
Firefox(根据需要):
Chrome 和 Edge:
边框不仅在右侧可见,顶部和底部也可见,并且超出了 li.last
。
最佳答案
调整 :after
元素的位置使其重叠并避免这种情况。因此,将 left:100%
改为 left:0
并调整 z-index
:
#nav {
background-color: #183650;
overflow: hidden;
}
ul {
margin: 0 auto;
width: 100%;
display: flex;
justify-content: center;
align-content: center;
}
li {
padding: 9px 0;
list-style: none;
}
li.last,
li.first {
background: none transparent;
position: relative;
}
li.last::after {
content: "";
position: absolute;
top: 0;
left: 0; /*changed this */
z-index:-1; /*Added this*/
width: 100vw;
height: 100%;
background-color: #20bef2;
}
li a {
border: none;
color: #FFF;
text-transform: uppercase;
font-size: 17px;
letter-spacing: 1px;
padding: 0.75em 0.7em;
}
li.last {
background-color: #20bef2;
border-left: 3px solid #FFF;
}
li a {
text-decoration: none;
}
li a:hover {
background: none transparent;
}
li:last-child {
background-color: #20bef2;
transform: translateZ(1px) skew(-15deg);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
li:last-child a {
transform: translateZ(1px) skew(15deg);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
<div id="nav">
<ul>
<li class="first"><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li class="last"><a href="#">Item</a></li>
</ul>
</div>
关于html - CSS 倾斜和变换在 Chrome 和 Edge 上添加了不需要的轮廓,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50911300/
我是初学者,我正在做一些练习来熟悉 CALayer ... 我只是想知道如何“倾斜”(或倾斜)CALayer 45° 角? 谢谢。 最佳答案 CALayers 有一个属性 affineTransfor
无法理解如何制作this trick或 this与CSS。我的意思是标题和标志。这条线不直。它们是倾斜的/倾斜的边界。能否请您举个例子或只是举例说明这是可行的? 最佳答案 看看https://jsfi
如何倾斜图像?例如,每个角都有一个 CGPoint,其坐标为 - p1、p2、p3、p4。然后,我需要设置 - p4.x+=50,p4.y+=30。因此这个角 (p4) 应该在 2D 透视中拉伸(st
我想弄清楚如何通过仅使用 css 来实现元素底部的跟随边框,并使其尽可能对跨浏览器友好 示例代码,带有标准边框 .object { width: 200px; height: 45p
我正在尝试使用 CSS transform 来倾斜 Bootstrap 导航 li,我可以做到这一点,但是当我尝试扭转内部链接上的倾斜时,li 倾斜也会反转回来。我不知道为什么。我试着做这里接受的答案
这个问题在这里已经有了答案: CSS: Set a background color which is 50% of the width of the window (14 个答案) 关闭 7 年前
我已经创建了一个预定的 div 来与我的导航栏一起使用,但是它弄乱了网站的其余格式。导航栏位于右上角,倾斜的 div 位于其下方,但它弄乱了网页上的所有其他内容。我一直在尝试一切都无济于事。 http
你好,我想像这里的附图一样对步骤菜单进行风格化。我该如何风格化这个?主要问题是菜单右侧的边框。 检查我的 JSFiddle URL https://jsfiddle.net/hcx1pv8x/ , 不
我正在尝试使用 HTML5 在 javascript 中倾斜 svg 元素,例如: 中的矩形元素是倾斜的,但 rect 元素也向右移动(不需要),我尝试手动设置位置使用 transform
目前我对应该倾斜的容器使用clip-path。 .box { height: 150px; line-height: 150px; text-align: center; backgr
我有一个相机从上方指向禅宗花园。然而,相机固定在侧面而不是直接在板的上方。结果,图像看起来像这样(注意矩形的倾斜形状): 有没有办法处理图像,使沙子区域看起来或多或少像一个完美的正方形? cap =
我正在尝试使用倾斜 350 度的 UIScrollview,我首先想到的是使用变换属性,滚动上的倾斜起作用了,但现在滚动上的所有内容看起来都不对,当我谈论所有内容时,我指的是位置和这个卷轴的所有 ch
我需要将我的应用程序升级到 Rails 3.2.16,当时我做了 bundle update rails它给了我以下错误。 Bundler could not find compatible vers
我正在尝试运行 rake db:migrate在本地,但我收到以下错误: Gem::LoadError: You have already activated rake 10.2.2, but you
很难用语言表达我想要完成的事情,所以请查看这张照片作为示例: 如您所见,我希望创建一个带有图案背景的倾斜 div(简单),但另一部分,即倾斜被半遮住的部分,也必须有背景图像。我想到了很多不同的想法,并
假设,我想将两个二维数组添加到第三个二维数组中。 我正在使用以下代码: cudaMallocPitch((void**)&device_a, &pitch, 2*sizeof(int),2); cud
很难用语言表达我想要完成的事情,所以请查看这张照片作为示例: 如您所见,我希望创建一个带有图案背景的倾斜 div(简单),但另一部分,即倾斜被半遮住的部分,也必须有背景图像。我想到了很多不同的想法,并
我刚刚遇到了这种附加字符串的变体,其中包含存储在变量中的值,这是我以前从未见过的。谁能帮我解释一下这是怎么回事? 这是我遇到的情况: var fruit = "banana"; $main = $('
假设,我想将两个二维数组添加到第三个二维数组中。 我正在使用以下代码: cudaMallocPitch((void**)&device_a, &pitch, 2*sizeof(int),2); cud
我正在尝试分析在 Windows 上运行的 Java UI 应用程序的 CPU 使用率。我将它连接到 VisualVM,但看起来 CPU 使用率最高的是 sum.rmi.transport.tcp.T
我是一名优秀的程序员,十分优秀!