<div class="box">
<h1>jQuery</h1>
<p>click() 方法是当按钮点击事件被触发时会调用一个函数。
该函数在用户点击 HTML 元素时执行。
当点击事件在某个 <p> 元素上触发时,隐藏当前的 <p> 元素:</p>
<p>dblclick()
当双击元素时,会发生 dblclick 事件。
dblclick() 方法触发 dblclick 事件,或规定当发生 dblclick 事件时运行的函数:</p>
</div>
*{margin: 0;padding: 0;}
body{
width: 100vw;height: 100vh;
background: #2d3436;
display: flex;
justify-content: center;
align-items: center;
}
.box{
width: 300px;height: 400px;
position: relative;
background: #2d3436;
color: #fff;
}
h1{
font-size: 24px;
text-align: center;
line-height: 30px;
margin-top: 20px;
margin-bottom: 10px;
}
p{
font-size: 16px;
word-wrap: break-word;
text-indent: 2em;
line-height: 30px;
padding: 12px;
}
.box::before,.box::after{
content: '';
background: linear-gradient(to top right,#b92b27,#2d3436,#1565c0);
top: -2px;left: -2px;right: -2px;bottom: -2px;
position: absolute;
z-index: -1;
}
.box::before{
filter: blur(20px);
}
案例来源:学习:HTML&CSS实现荧光边框效果