常用公共css

本文详细介绍了如何使用CSS进行样式重置,确保不同浏览器的一致性显示,并提供了常用的宽度和高度设置,适用于前端开发人员快速上手。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/* 重置文件 */
body {
  font: 12px/1.5 "Microsoft Yahei", tahoma, arial, "Hiragino Sans GB";
  color: #999;
}

html,
body,
ol,
ul,
li,
dl,
dt,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
fieldset,
legend,
form,
img,
input {
  margin: 0;
  padding: 0;
}

a {
  color: #999;
  text-decoration: none;
}

ul,
ol,
li {
  list-style: none;
}

img {
  display: block;
  border: 0;
}

i,
em,
b,
strong {
  font-style: normal;
  font-weight: normal;
}

/* 重置表单控件样式 */
textarea:focus{ outline: none; }
input{ border: none; outline: none; }
::-webkit-input-placeholder{ /* WebKit, Blink, Edge */ color: #999; }
:-moz-placeholder{ /* Mozilla Firefox 4 to 18 */ color: #999; }
::-moz-placeholder{ /* Mozilla Firefox 19+ */ color: #999; }
:-moz-placeholder, ::-moz-placeholder{ opacity: 1; }
:-ms-input-placeholder{ /* Internet Explorer 10-11 */ color: #999; }

/* 清除浮动 */
.clearfix:after {
  content: "";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

/* 常用宽度 */
.w100 {
  width: 100px;
}

.w200 {
  width: 200px;
}

/* 常用高度 */
.h40 {
  height: 40px;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值