HTML5 公共样式

本文详细介绍了一种基于最大优先实现法的CSS全局样式设置方案,强调了从全局到局部的样式覆盖原则,包括如何通过不同层级定义样式以提高代码的复用性和可维护性。

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

/*
* -- 样式说明 --
* 最大优先实现法,全局能实现不用区域,区域能实现不用模板,
* 模板能实现不用界面,界面能实现不用标签
* 脚本属于特殊标签
* g - 全局
* t - 区域
* m - 模板
* ui - 界面
* lb - 标签
* j - 脚本
*/
/*base style*/
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, menu, nav, section, time, mark, audio, video, details, summary{ margin:0; padding:0;}
body{ font-family:\5FAE\8F6F\96C5\9ED1,'Arial'; color:#333; font-size:12px; background-color:#fff; overflow-x:hidden;}
a{ color:#666; text-decoration:none;}
a:hover{ color:#666; text-decoration:underline;}
img{ border:none;}
i,em{ font-style:normal;}
ul li{ list-style-type:none;}
textarea{ resize:vertical;}
input, select, textarea{ font-family:\5FAE\8F6F\96C5\9ED1,'Arial'; background-color:#fff margin:0; padding:0; outline:none;}

/*global style*/
.g-fl{ float:left;}
.g-fr{ float:right;}
.g-c{ clear:both;}

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值