在前端开发中,我们通常会遇到浏览器的默认样式问题。浏览器默认样式可能会影响了我们自定义样式效果,因此,我们需要使用CSS去除浏览器的默认样式。
* { margin: 0; padding: 0; } body { font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 16px; line-height: 1.5; } ul { list-style: none; } a { text-decoration: none; color: #333; } button,input,optgroup,select,textarea { -webkit-appearance: none; -moz-appearance: none; appearance: none; outline: none; border: none; background-color: transparent; margin: 0; } input[type="text"],input[type="email"],input[type="search"],input[type="password"],input[type="number"],textarea { Box-sizing: border-Box; border: none; outline: none; font-family: 'Helvetica Neue',sans-serif; font-size: 16px; line-height: 20px; } button,input[type="submit"] { cursor: pointer; background-color: #333; color: #fff; font-family: 'Helvetica Neue',sans-serif; font-size: 16px; line-height: 20px; padding: 10px 20px; border-radius: 3px; }
以上代码可以去除浏览器默认样式,同时,也能提升网站的用户体验。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。