移动端页面a input去除点击效果 及 pc端切换

29 篇文章 0 订阅
23 篇文章 0 订阅

1 手机端页面a button input去除点击效果以及闪屏问题 添加:

a,
button,
input {
    -webkit-tap-highlight-color: rgba(255, 0, 0, 0);
}

  2 使用border创建小三角形

span {
        height: 0px;
        width: 0px;
        border-top: 5px solid #006633;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
    }

  3 去除点击效果

outline:none;

background:none;

box-shadow:none;

 4 移动端和pc端使用不同页面,判断设备是pc端还是移动端,并进行链接的切换跳转

 window.onload = function() {
                function isPC() {
                    var userAgentInfo = navigator.userAgent;
                    var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
                    var flag = true;
                    for(var v = 0; v < Agents.length; v++) {
                        if(userAgentInfo.indexOf(Agents[v]) > 0) {
                            flag = false;
                            break;
                        }
                    }
                    return flag;
                }

                if(!isPC()) {
                    window.location.href = "home.html";
                }
            }

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我可以给您提供一个简单的登录页面的 HTML 和 CSS 代码,并且可以适配不同的屏幕大小。以下是代码示例: HTML代码: ``` <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>登录页面</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="style.css"> </head> <body> <div class="container"> <h1>欢迎登录</h1> <form> <label for="username"><b>用户名</b></label> <input type="text" placeholder="请输入用户名" name="username" required> <label for="password"><b>密码</b></label> <input type="password" placeholder="请输入密码" name="password" required> <button type="submit">登录</button> <label> <input type="checkbox" checked="checked" name="remember">记住我 </label> </form> </div> </body> </html> ``` CSS代码: ``` * { box-sizing: border-box; } body { margin: 0; font-family: Arial, Helvetica, sans-serif; background-color: #f1f1f1; } .container { padding: 16px; background-color: #fff; } h1 { text-align: center; color: #333; } input[type=text], input[type=password] { width: 100%; padding: 12px 20px; margin: 8px 0; display: inline-block; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } button[type=submit] { background-color: #4CAF50; color: white; padding: 14px 20px; margin: 8px 0; border: none; border-radius: 4px; cursor: pointer; width: 100%; } button[type=submit]:hover { background-color: #45a049; } label { display: block; color: #666; } input[type=checkbox] { margin-top: 16px; } @media screen and (min-width: 768px) { /* PC样式 */ .container { width: 50%; margin: 50px auto; } } @media screen and (max-width: 767px) { /* 移动样式 */ .container { width: 90%; margin: 50px auto; } } ``` 该页面使用了一个容器来包含登录表单,使用了一些常见的样式来美化表单元素。在 CSS 代码中,我们使用了媒体查询来适配不同大小的屏幕。在屏幕宽度大于等于 768px 时,应用 PC 样式;在屏幕宽度小于 768px 时,应用移动样式。 希望这个登录页面的示例能够帮助到您!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值