Laravel  
laravel
文档
数据库
架构
入门
php技术
    
Laravelphp
laravel / php / java / vue / mysql / linux / python / javascript / html / css / c++ / c#

css手指样式

作者:飒舛流寒   发布日期:2026-01-07   浏览:51

/* CSS手指样式示例 */

/* 1. 手指点击效果 - 使用伪类 :active */
.button {
    background-color: #4CAF50;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    cursor: pointer;
    width: 100%;
}

.button:active {
    background-color: #3e8e41;
    transform: translateY(4px);
}

/* 解释:当按钮被点击时,背景颜色会变深,并且按钮会向下移动4px,模拟按下效果。 */

/* 2. 手指悬停效果 - 使用伪类 :hover */
.link {
    text-decoration: none;
    color: blue;
}

.link:hover {
    text-decoration: underline;
    color: red;
}

/* 解释:当鼠标悬停在链接上时,文本颜色变为红色并添加下划线,模拟手指悬停的效果。 */

/* 3. 手指触摸效果 - 使用 touch-action 属性 */
.touch-element {
    touch-action: manipulation;
    transition: transform 0.3s;
}

.touch-element:active {
    transform: scale(0.9);
}

/* 解释:当元素被触摸时,它会缩放至原来的90%,模拟手指触摸的反馈效果。 */

上一篇:css点击后变颜色

下一篇:css小手

大家都在看

css好看的字体

css 红色

css 瀑布流布局grid

换行 css

css文字超长省略号

css背景图铺满

css 渐变字体

css背景图片等比例缩放

css文字删除线

css 文本下划线

Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3

Laravel 中文站