点击查看html编辑器说明文档

CSS鼠标移入移出过渡效果edit icon

|
|
Fork(复制)
|
|
作者:
穿越者X57

👉 新版编辑器已上线,点击进行体验吧!

BUG反馈
嵌入
设置
下载
HTML
格式化
支持Emmet,输入 p 后按 Tab键试试吧!
<head> ...
展开
</head>
<body>
            
            <h1>Hover Me</h1>
        
</body>
CSS
格式化
            
            h1 {
  position: relative;
  font-size: 4em;
}

h1::before {  
  transform: scaleX(0);
  transform-origin: bottom right;
}

h1:hover::before {
  transform: scaleX(1);
  transform-origin: bottom left;
}

h1::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  inset: 0 0 0 0;
  background: #FF69B4;
  z-index: -1;
  transition: transform .25s ease;
}


body {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffe;
}


        
JS
格式化
            
            
        
预览
控制台