- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有一个六边形网格,当它们的形状变为正方形时不显示悬停效果。我正在使用此库中的效果 https://github.com/IanLunn/Hover ( https://cdn.bootcss.com/hover.css/2.1.1/css/hover.css )有谁知道如何解决这个问题?
如有任何帮助,我们将不胜感激。干杯................................................. ..................................................... ..................................................... …………
/* grid of hexagons */
.hex-background {
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.hex-background .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
}
.hex-background:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid {
width: 90%;
max-width: 1000px;
margin: 0 auto;
padding: 0;
}
.grid li {
list-style-type: none;
position: relative;
float: left;
width: 18%;
padding-bottom: 20.78461%;
-o-transform: rotate(-60deg) skewY(30deg);
-moz-transform: rotate(-60deg) skewY(30deg);
-webkit-transform: rotate(-60deg) skewY(30deg);
-ms-transform: rotate(-60deg) skewY(30deg);
transform: rotate(-60deg) skewY(30deg);
overflow: hidden;
visibility: hidden;
}
.grid li:nth-child(2n) {
margin: 0 1%;
}
.grid li:nth-child(10n+6),
.grid li:nth-child(10n+7),
.grid li:nth-child(10n+8),
.grid li:nth-child(10n+9),
.grid li:nth-child(10n+10) {
margin-top: -4.5%;
margin-bottom: -4.5%;
-o-transform: translateX(48%) rotate(-60deg) skewY(30deg);
-moz-transform: translateX(48%) rotate(-60deg) skewY(30deg);
-webkit-transform: translateX(48%) rotate(-60deg) skewY(30deg);
-ms-transform: translateX(48%) rotate(-60deg) skewY(30deg);
transform: translateX(48%) rotate(-60deg) skewY(30deg);
}
.grid li .hexagon {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
-o-transform: skewY(-30deg) rotate(60deg);
-moz-transform: skewY(-30deg) rotate(60deg);
-webkit-transform: skewY(-30deg) rotate(60deg);
-ms-transform: skewY(-30deg) rotate(60deg);
transform: skewY(-30deg) rotate(60deg);
overflow: hidden;
/*background images*/
}
.grid li .hexagon.img1 {
background: url("https://c2.staticflickr.com/6/5560/15235542331_fbe56a772e_b.jpg");
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.grid li .hexagon.img1 .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
}
.grid li .hexagon.img1:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid li .hexagon.img2 {
background: url("https://c2.staticflickr.com/8/7490/16150657349_cf9be4ce7e_b.jpg");
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.grid li .hexagon.img2 .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
}
.grid li .hexagon.img2:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid li .hexagon.img3 {
background: url("https://c2.staticflickr.com/6/5205/5262879347_26a831f439_b.jpg");
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.grid li .hexagon.img3 .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
}
.grid li .hexagon.img3:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid li * {
visibility: visible;
}
.grid li p {
transform: translateY(100%);
text-align: center;
color: #fff;
}
.clear:after {
content: "";
display: block;
clear: both;
}
@media only screen and (max-width: 768px) {
.grid li {
display: inline-block;
width: 49%;
padding: 0;
height: 35%;
padding-bottom: 0%;
-o-transform: none;
-moz-transform: none;
-webkit-transform: none;
-ms-transform: none;
transform: none;
overflow: visible;
visibility: visible;
padding-bottom: 2%;
}
.grid li:nth-child(2n+1) {
margin-right: 2%;
}
.grid li:nth-child(2n) {
margin: 0 0%;
}
.grid li .hexagon {
position: relative;
top: none;
left: none;
width: 100%;
height: 200px;
-o-transform: none;
-moz-transform: none;
-webkit-transform: none;
-ms-transform: none;
transform: none;
}
.grid li:nth-child(10n+6),
.grid li:nth-child(10n+7),
.grid li:nth-child(10n+8),
.grid li:nth-child(10n+9),
.grid li:nth-child(10n+10) {
margin-top: 0%;
margin-bottom: 0%;
-o-transform: none;
-moz-transform: none;
-webkit-transform: none;
-ms-transform: none;
transform: none;
}
}
@media only screen and (max-width: 400px) {
.grid li {
display: inline-block;
width: 100%;
height: 35%;
padding-bottom: 10px;
}
.grid li:nth-child(2n+1) {
margin-right: 0%;
}
}
/*hover effects*/
/*!
* Hover.css (http://ianlunn.github.io/Hover/)
* Version: 2.2.0
* Author: Ian Lunn @IanLunn
* Author URL: http://ianlunn.co.uk/
* Github: https://github.com/IanLunn/Hover
* Hover.css Copyright Ian Lunn 2017. Generated with LESS.
*/
/* Sweep To Right */
.hvr-sweep-to-right {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-sweep-to-right:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #2693ff;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transform-origin: 0 50%;
transform-origin: 0 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-sweep-to-right:hover,
.hvr-sweep-to-right:focus,
.hvr-sweep-to-right:active {
color: white;
}
.hvr-sweep-to-right:hover:before,
.hvr-sweep-to-right:focus:before,
.hvr-sweep-to-right:active:before {
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
/* Sweep To Bottom */
.hvr-sweep-to-bottom {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-sweep-to-bottom:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #2693ff;
-webkit-transform: scaleY(0);
transform: scaleY(0);
-webkit-transform-origin: 50% 0;
transform-origin: 50% 0;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-sweep-to-bottom:hover,
.hvr-sweep-to-bottom:focus,
.hvr-sweep-to-bottom:active {
color: white;
}
.hvr-sweep-to-bottom:hover:before,
.hvr-sweep-to-bottom:focus:before,
.hvr-sweep-to-bottom:active:before {
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
/* Radial Out */
.hvr-radial-out {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
overflow: hidden;
background: #e1e1e1;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-radial-out:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #2693ff;
border-radius: 100%;
-webkit-transform: scale(0);
transform: scale(0);
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-radial-out:hover,
.hvr-radial-out:focus,
.hvr-radial-out:active {
color: white;
}
.hvr-radial-out:hover:before,
.hvr-radial-out:focus:before,
.hvr-radial-out:active:before {
-webkit-transform: scale(2);
transform: scale(2);
}
/* Shutter Out Horizontal */
.hvr-shutter-out-horizontal {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
background: #e1e1e1;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-shutter-out-horizontal:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #2693ff;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transform-origin: 50%;
transform-origin: 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-shutter-out-horizontal:hover,
.hvr-shutter-out-horizontal:focus,
.hvr-shutter-out-horizontal:active {
color: white;
}
.hvr-shutter-out-horizontal:hover:before,
.hvr-shutter-out-horizontal:focus:before,
.hvr-shutter-out-horizontal:active:before {
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
<!doctype html>
<html>
<head>
<!--<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/hover.css/2.1.1/css/hover.css">-->
</head>
<body>
<ul class="grid">
<li>
<a href=""><div class="hexagon img1 hvr-sweep-to-right"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img2 hvr-sweep-to-bottom"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img3 hvr-radial-out"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img1 hvr-shutter-out-horizontal"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img2 hvr-sweep-to-right"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img3 hvr-sweep-to-bottom"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img1 hvr-radial-out"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img2 hvr-shutter-out-horizontal"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img3 hvr-sweep-to-right"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img1 hvr-sweep-to-bottom"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img2 hvr-radial-out"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img3 hvr-shutter-out-horizontal"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img1 hvr-sweep-to-right"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img2 hvr-sweep-to-bottom"><div class="text">Hello World</div></div></a>
</li>
<li>
<a href=""><div class="hexagon img3 hvr-radial-out"><div class="text">Hello World</div></div></a>
</li>
</ul>
</body>
</html>
最佳答案
我认为悬停不适用于移动设备。因为 :hover 需要一个指针来激活。 There are more details here
关于当六边形更改为正方形时,CSS 悬停效果不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45559208/
我试图使用 显示正方形(如元素符号正方形) .squares{ list-style-type: square; display:inline; } 但我希望它们是水
这是关于在作为 4 个 div 的一部分的 1 个 div 中嵌套 4 个 div(正方形)... 我在包装器中使用 display: flex 并用于包装的元素本身,否则它不会工作 对我来说,这感觉
这是图像,我想填充此矩形或正方形的边缘,以便可以使用轮廓对其进行裁剪。到目前为止,我所做的是我使用了canny边缘检测器来找到边缘,然后使用bitwise_or或将这个矩形填充了一点,但没有完全填充。
我希望能够在图片框内创建 X x Y 数量的框/圆圈/按钮。完全像 Windows 碎片整理工具。 我尝试创建一个布局并不断向其添加按钮或图片框,但速度非常慢,在添加 200 个左右的图片框后它崩溃,
我正在尝试从图像(肺部图像)中提取 3 个区域,这些区域在软组织中显示,每个区域都是具有特定高度和宽度的正方形,例如宽高各10mm,如下图, 如图所示,该区域也是均匀的,这意味着它只包含相同的颜色(在
在我左键单击它后,我试图让一个正方形跟随我的鼠标。当我右键单击时,方 block 应该停止跟随我的鼠标。 我的程序检测到我在方 block 内单击,但由于某种原因,它没有根据 Mouse.getDX/
已经花了几个小时在这上面了(因为我还在学习),所以也许你们可以帮忙。问题是我无法弄清楚如何将二维数组划分为所有可能的 nxn 正方形。 我正在随机化二维数组,可以说它是这样的: 1 0 1 0 2
使用 Graph API,我可以获得小型、大型、中型图片。或者我可以获得小方形图片。 但是我怎样才能得到大方形图片呢?有什么服务可以使用吗? 最佳答案 很简单,我刚发现这个。 例子, https://
我是 HTML 和 CSS 的新手。 尝试创建 3 x 3 正方形“图片”,使用 ,但无法找到将正方形放在页面中间的简单解决方案,例如中间有九个正方形。 如何把所有的方 block 都放在大边框的正方
我正在玩弄 CSS 动画以获得乐趣。我有限的经验阻碍了这一进程。 下面的脚本将圆形转换为三 Angular 形,再转换为正方形,然后反转。然而,圆形和三 Angular 形之间的动画有一个小错误。我希
我的标准布局(最小宽度 1024 像素)有 4 行。第一个和最后一个有 6 个正方形,中间有两个组合正方形。但是第三行的第一个方 block 不见了。我没有使用不同的 CSS 设置。我试过 clear
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 7 年前。 Improve this q
我的网站上有 4 张图片,我试图对其进行定位,以便它们在我的 DIV 中形成一个相等的正方形,但它看起来像一条由 4 张图片组成的垂直线。我希望它看起来像 2 个图像的 2 条垂直线,彼此相邻,使其成
这是方 block 检测示例的输出我的问题是过滤这个方 block 第一个问题是它为同一区域绘制多条线; 第二个是我只需要检测对象而不是所有图像。 另一个问题是我必须只取除所有图像之外的最大对象。 检
我正在绘制一个带有移动立方体(正方形,因为它是 2d)算法的元球。一切都很好,但我想将其作为矢量对象获取。 到目前为止,我已经从每个事件方 block 中得到一两条矢量线,将它们保存在列表线中。换句话
实际上,我有一个适用于 Android 1.5 的应用程序,其中包含一个 GLSurfaceView 类,它在屏幕上显示一个简单的方形多边形。 我想学习如何添加一个新功能,即移动用手指触摸的方 blo
如果我有一个包含多个子组件的 JPanel,我该如何使 JPanel 保持正方形,而不管其父组件的大小如何调整?我尝试了以下代码的变体,但它不会导致子组件也变成正方形。 public void pai
我找到了 this answer ,它确保 ImageView 的宽高比得以保留。 我如何使用带有可绘制背景的 TextView 来做到这一点?我有这个 TextView: 这是我的背
这个问题在这里已经有了答案: Maintain aspect ratio of a div according to height [duplicate] (1 个回答) 关闭 8 年前。 是否可以
如何创建 div Logo ,如下图所示: 这是我在 JsFiddle 中创建的 主要问题是如何将两个形状如下图的盒子连接起来,有人可以提出建议吗? body,html { width: 100%
我是一名优秀的程序员,十分优秀!