- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我尝试使用缩放属性将每个紫色和文本从内到外悬停。
像这样:
https://i.imagesup.co/images2/9fadd677f1625d887fdbd4819af96ee4acb6fe89.png
两个问题:
持续时间不影响(尝试将其置于悬停类而不是悬停类,但仍然如此)。
当我的鼠标在紫色的顶部时,它就像一个放大和缩小的循环:
这是相关代码,感谢帮助!
** 我希望 duration 属性在我离开鼠标时处于第一类,以获得相同的效果。
body {
margin: 0 auto;
overflow-x: hidden;
}
#divStyle1 {
height: 90vh;
background-color: #016087;
}
#purpuleLineBox {
position: absolute;
top: 25%;
}
#purpuleLine1 {
background-color: #D52C82;
height: 7vh;
width: 30vw;
margin-bottom: 30px;
}
#purpuleLine2 {
background-color: #D52C82;
height: 7vh;
width: 38vw;
margin-bottom: 30px;
}
#purpuleLine3 {
background-color: #D52C82;
height: 7vh;
width: 42vw;
margin-bottom: 30px;
}
#purpuleLine4 {
background-color: #D52C82;
height: 7vh;
width: 50.5vw;
margin-bottom: 30px;
}
#purpuleLine5 {
background-color: #D52C82;
height: 7vh;
width: 52.5vw;
margin-bottom: 30px;
}
div>p {
color: white;
text-shadow: 2px 2px black;
font-weight: bold;
font-size: 2vw;
margin-left: 7px;
position: relative;
top: 5%;
}
.purpuleHover {
zoom: 100%;
transition-duration: 0.5s;
}
.purpuleHover:hover {
zoom: 120%;
}
<div id="divStyle2">
<main>
<div id="purpuleLineBox">
<div id="purpuleLine1" class="purpuleHover">
<p>100% recyclable and bio-degradable</p>
</div>
<div id="purpuleLine2" class="purpuleHover">
<p>Simulates the natural ripening process, organic</p>
</div>
<div id="purpuleLine3" class="purpuleHover">
<p>The quickest way to achieve the perfect avocado taste</p>
</div>
<div id="purpuleLine4" class="purpuleHover">
<p>Work with Mango, Banana, Peach, and another climacteric fruits</p>
</div>
<div id="purpuleLine5" class="purpuleHover">
<p>The user interface on the bag shows when an avocado is fully ripen</p>
</div>
</div>
</main>
</div>
最佳答案
您需要添加一个 transition-property
,它定义了转换应该处理的 css 属性,而不仅仅是 transition-duration
.您可以使用单独的减速来执行此操作,或者将它们与速记一起定义 transition
.
此外,您必须将 zoom 替换为 transform: scale()
.
body {
margin: 0 auto;
overflow-x: hidden;
}
#divStyle1 {
height: 90vh;
background-color: #016087;
}
#purpuleLineBox {
position: absolute;
top: 25%;
}
#purpuleLine1 {
background-color: #D52C82;
height: 7vh;
width: 30vw;
margin-bottom: 30px;
}
#purpuleLine2 {
background-color: #D52C82;
height: 7vh;
width: 38vw;
margin-bottom: 30px;
}
#purpuleLine3 {
background-color: #D52C82;
height: 7vh;
width: 42vw;
margin-bottom: 30px;
}
#purpuleLine4 {
background-color: #D52C82;
height: 7vh;
width: 50.5vw;
margin-bottom: 30px;
}
#purpuleLine5 {
background-color: #D52C82;
height: 7vh;
width: 52.5vw;
margin-bottom: 30px;
}
div>p {
color: white;
text-shadow: 2px 2px black;
font-weight: bold;
font-size: 2vw;
margin-left: 7px;
position: relative;
top: 5%;
}
.purpuleHover {
position: relative;
transform: scale(1);
transition: transform 0.5s;
transform-origin: top left;
}
.purpuleHover:hover {
transform: scale(2);
z-index: 1;
}
<div id="divStyle2">
<main>
<div id="purpuleLineBox">
<div id="purpuleLine1" class="purpuleHover">
<p>100% recyclable and bio-degradable</p>
</div>
<div id="purpuleLine2" class="purpuleHover">
<p>Simulates the natural ripening process, organic</p>
</div>
<div id="purpuleLine3" class="purpuleHover">
<p>The quickest way to achieve the perfect avocado taste</p>
</div>
<div id="purpuleLine4" class="purpuleHover">
<p>Work with Mango, Banana, Peach, and another climacteric fruits</p>
</div>
<div id="purpuleLine5" class="purpuleHover">
<p>The user interface on the bag shows when an avocado is fully ripen</p>
</div>
</div>
</main>
</div>
关于html - 过渡持续时间在特定的 div 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58755709/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!