翻译过一篇:提高css的可读性 http://xo-tobacoo.iteye.com/blog/190498
贴个例子,和我们管理管理java文档有异曲同工之妙:
html, body, div, p, ul, ol, li, form, fieldset, h1, h2, h3, h4, h5, h6, address { margin: 0; padding: 0; list-style: none; }
html { background: #000 url('../images/bg-html.gif') repeat-x; }
body { font: normal 62.8%/1.3 Tahoma, "Lucida Grande CE", lucida, sans-serif; color: #64030a; padding-bottom: 50px; background: url('../images/bg-body.jpg') 20% 0 no-repeat; }
a { color: #660306; }
a:hover { color: #c61116; text-decoration: underline !important; }
a img { border:0; }
input,
select,
textarea { font-family: lucida, sans-serif; font-size: 1em; vertical-align: middle; }
input.button,
select.button,
textarea.button { background: #fff; padding: 2px 0; border: none; color: #000 !important; }
button.button { margin: 0; padding: 0; height: 18px; border: none; text-decoration: underline; font-weight: bold; color: #00CCFF; cursor: pointer; }
input.submit { width: 87px !important; height: 22px; overflow: visible; padding: 0 5px; color: #fff; font-weight: bold; border: none; cursor: pointer; }
label { cursor: pointer; padding-right: 5px; line-height: 20px; }
h1 { font-size: 2em; margin-bottom: .5em; }
h2 { font-size: 1.7em; }
h3 { font-size: 1.5em; }
h4 { font-size: 1.3em; }
h5 { font-size: 1.2em; }
h6 { font-size: 1em; }
h1, h2, h3, h4, h5, h6 { color: #c61116; }
table { border-collapse: collapse; width: 100%; }
table th { text-align: left; }
table td.right { padding-left: 5px; }
table th.right { padding-left: 5px; }
table td.left { padding-right: 5px; }
table th.left { padding-right: 5px; }
blockquote { margin: 0; padding: 10px 20px; color: #333333; line-height: 1.6; font-family: Georgia, serif; }
fieldset { border: 0 !important; }
/* -- User friendly features --*/
.hidden { display: none; }
.noscreen { width: 200px; position: absolute; left: -9999px; top: -9999px; }
/* -- Basics layout -- */
#view { position: relative; }
#head { font-size: 1.2em; position: relative; z-index: 10; }
#content { font-size: 1.3em; position: relative; z-index: 1; }
#menu { font-size: 1.2em; }
#foot { font-size: 1.2em; position: relative; z-index: 1; }
/* -- Main classes -- */
.fr { float: right !important; }
.fl { float: left !important; }
.clear { clear: both !important; }
.right { text-align: right !important; }
.left { text-align: left !important; }
.center { text-align: center !important; }
.last { margin-right: 0 !important; margin-bottom: 0 !important; border-bottom: none !important; padding-bottom: 0 !important; background: none; }
.small { font-size: .90em; }
.big { font-size: 1.2em; }
.biggest { font-size: 2.3em; }
.light { color: #999999 !important; }
.alt { font-weight: bold; }
/* -- Main icons -- */
.ico { position: relative; padding-right: 30px; height: 20px; padding-bottom: 2px; vertical-align: middle; background: 100% 0 no-repeat; }
.ico-more { background-image: url('../images/ico/ico-more.gif'); }
/* -- Forms layout -- */
.formBox .lab { float: left; width: 19%; text-align: right; padding-right: 1%; }
.formBox .con { float: right; width: 80%; }
.formBox .button:focus { border-color: #000; }
/* -- Layout -- */
#view { width: 954px; margin: 0 auto; padding: 0 5px; background: url('../images/bg-shadow.png') 0 77px no-repeat; }
#head { height: 167px; }
#menu { position: absolute; top: 83px; left: 5px; z-index: 100; width: 954px; height: 84px; overflow: hidden; background: #181502 url('../images/bg-menu.gif') no-repeat; }
#content { padding: 25px 29px 40px 26px; margin-bottom: 3px; overflow: hidden; background-color: #fff; }
#foot { height: 51px; padding: 12px 25px 0; background: #2b0b00 url('../images/bg-footer.gif') repeat-x; clear: both; }
.subheader { margin-bottom: 24px; padding-left: 5px; font-weight: normal; font-family: Georgia, "New York CE", utopia, serif; }
#printPage { position: absolute; right: 25px; top: 25px; }
/* Header */
#logotype { float: left; display: block; padding: 18px 12px; font-size: 3em; font-weight: normal; font-family: Georgia, "New York CE", utopia, serif; }
#logotype,
#logotype * { color: #fefea2; text-decoration: none !important; }
/* Search Form */
#searchForm { position: absolute; top: 0; right: 0; width: 300px; text-align: right; padding: 28px 1px; font-size: 1.1em; }
#searchForm .button { width: 180px; height: 17px; padding: 5px 10px; margin-right: 5px; }
#searchForm .submit { width: 87px !important; height: 29px; background: #c40000 url('../images/bg-search-submit.gif') no-repeat; }
/* Menus */
#mainMenu { position: absolute; top: 42px; left: 0; height: 42px; padding: 0 28px; }
#mainMenu li { font-size: 1.5em; margin-right: 2px; float: left; }
#mainMenu li a,
#mainMenu li strong { display: block; width: 145px; height: 42px; float: left; padding-top: 10px; text-align: center; color: #fefea2; text-decoration: none !important; font-family: Georgia, "New York CE", utopia, serif; background: url('../images/bg-menu-item.gif') 0 0 no-repeat; }
#mainMenu li strong { color: #c61116; font-weight: normal; background: #fff url('../images/bg-menu-item.gif') 0 -42px no-repeat; }
#mainMenu li a:hover { text-decoration: underline !important; }
#subMenu { position: absolute; top: 0; right: 0; padding: 17px 26px; }
#subMenu li { display: inline; margin-left: 8px; }
#subMenu li a { color: #fffec5; }
/* Right sidebox */
#rightBlock { width: 274px; float: right; padding: 35px 0; }
#rightBlock .box { position: relative; margin-bottom: 30px; }
#rightBlock .submenu { margin-bottom: 50px; }
#rightBlock .submenu .in { background: url('../images/bg-submenu_top.gif') no-repeat; }
#rightBlock .submenu .in ul { padding: 1px 3px 1px 1px; font-size: 1.1em; background: url('../images/bg-submenu_bottom.gif') 0 100% no-repeat; }
#rightBlock .submenu .in ul li a,
#rightBlock .submenu .in ul li strong { display: block; height: 32px; padding: 12px 5px 0 30px; background: url('../images/bg-submenu-item.gif') 0 0 no-repeat; }
#rightBlock .submenu .in ul li strong { color: #9c3134; background: #fffed5 url('../images/bg-submenu-item.gif') 0 -44px no-repeat; }
#rightBlock .contact .in { padding: 30px 15px; height: 161px; background: #1f1b02 url('../images/bg-contact.gif') no-repeat; }
#rightBlock .contact .in * { color: #fffed5; }
#rightBlock .contact .in address { font-style: normal; margin-top: 20px; }
#rightBlock .contact .in .phone { color: #fff; }
#rightBlock .contact .in .more { position: absolute; bottom: 20px; right: 15px; }
#rightBlock .rss a { display: block; height: 40px; color: #fffed5; padding: 20px 0 0 64px; text-decoration: none; background: #b65c02 url('../images/bg-rss.gif') no-repeat; }
#rightBlock .rss a strong { text-decoration: underline; }
/* Left content part */
#contentBlock { width: 610px; float: left; padding: 25px 0; }
#contentBlock .subheader { margin-bottom: 20px !important; }
/* Article items */
#contentBlock .item { position: relative; width: 554px; padding: 20px 28px 0; margin-bottom: 10px; line-height: 1.4em; }
#contentBlock .first { background: url('../images/bg-item_first.jpg') no-repeat; }
#contentBlock .item .subheader { margin-bottom: 25px !important; padding: 0; }
#contentBlock .item .date { position: absolute; top: 16px; right: 16px; width: 80px; height: 23px; text-align: center; font-size: 1.4em; color: #fff; padding-top: 6px; background: url('../images/bg-item_date.png') no-repeat; }
#contentBlock .item .in { overflow: hidden; padding-bottom: 35px; background: url('../images/bg-item_separator.gif') 50% 100% no-repeat; }
#contentBlock .last .in { background: none !important; }
#contentBlock .item .in img,
#contentBlock .item .in a img { border: 3px #d4a65d solid; }
#contentBlock .item .in a:hover img { border-color: #a8803f; }
#contentBlock .item .in img { margin: 2px 6px 15px 0; }
#contentBlock .item .in img.left { float: left; margin: 2px 15px 10px 0; }
#contentBlock .item .in img.right { float: right; margin: 2px 0 10px 15px; }
#contentBlock .item .in ul,
#contentBlock .item .in ol,
#contentBlock .item .in p,
#contentBlock .item .in table { margin-bottom: 2em; }
#contentBlock .item .in ul { padding-left: 20px; }
#contentBlock .item .in ol { padding-left: 35px; }
#contentBlock .item .in ol li { list-style: decimal !important; }
#contentBlock .item .in ul li { margin: 3px 0; padding-left: 15px; background: url('../images/bg-inlink.gif') 0 .4em no-repeat; }
#contentBlock .item .in table td,
#contentBlock .item .in table th { padding: 5px 10px; border: 1px #660306 solid; }
#contentBlock .item .in table th { background-color: #660306; color: #fff; }
/* Footer */
#foot * { color: #fffec5; }
#foot .menu { padding-bottom: 20px; }
#foot .menu li { display: inline; margin-right: 16px; float: left; }
#foot p.copy { float: left; clear: left; width: 48%; }
#foot .support { position: absolute; top: 12px; right: 25px; width: 200px; text-align: right; }
#foot .support .hotmix { margin-top: 4px; float: right; }
#foot .support .hotmix a { position: relative; width: 55px; height: 13px; float: left; display: block; margin: 2px 0 0 5px; overflow: hidden; cursor: pointer; }
#foot .support .hotmix a span { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url('../images/bg-hotmix.gif') 0 0 no-repeat; }
#foot .support .lt { position: relative; display: block; clear: both; float: right; right: -25px; top: 20px; }
#foot .support .lt a { position: relative; width: 14px; height: 14px; display: block; overflow: hidden; cursor: pointer; }
#foot .support .lt a span { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url('../images/bg-lt.gif') 0 0 no-repeat; }
#foot a:hover { color: #fff !important; }
分享到:
相关推荐
在jsp中经常用到css结构,使用 css结构布局网站,会使网站变得更加清晰,更统一维护
CSS 结构和规则
ASP实例开发源码—希瑞电驴爬虫第五版(DIV+CSS结构).zip ASP实例开发源码—希瑞电驴爬虫第五版(DIV+CSS结构).zip ASP实例开发源码—希瑞电驴爬虫第五版(DIV+CSS结构).zip
ASP源码—希瑞电驴爬虫第五版(DIV+CSS结构).zip
基于ASP的希瑞电驴爬虫第五版(DIV+CSS结构).zip
awesome 是sotayamashita发起维护CSS资源列表,内容包括:CSS前置器,框架,CSS结构,代码风格指南,命名习惯,播客,演讲视频,大网站CSS开发经验等等。 Awesome系列虽然挺全,但基本只对收录的资源只是极为简要的...
此网站模板是之前按一个企业客户的要求模仿的,今天准备清理硬盘,舍不得...模板文件在template/diy目录下的lanmu.css,熟练CSS语法的朋友可以修改这个文件重新制作自己喜欢的风格,喜欢的朋友记得顶一下算是给个支持。
CSS 索引│CSS 结构│CSS 属性 -------------------------------------------------------------------------------- 现在开始样式表! 仅仅改变一个文件就可以改变数百个网页的外观......个性化的表现而不损失...
网页设计与制作
CSS 结构和规则 各种选择符、伪类、伪元素和层叠顺序的入门。 CSS 属性 各种层叠样式表级别一有效的属性的描述。 将样式表加入到HTML中 各种将样式表加入到HTML文本中的方法。 依赖样式表 怎样会是滥用...
基本css 基本CSS-仅用一个文件创建CSS结构。
CSS 结构和规则 各种选择符、伪类、伪元素和层叠顺序的入门。 CSS 属性 各种层叠样式表级别一有效的属性的描述。 将样式表加入到HTML中 各种将样式表加入到HTML文本中的方法。 依赖样式表 怎样会是滥用...
纯CSS和HTML打造树结构
itcss-sample:一个简单的ITCSS结构示例
CSS 结构和规则 各种选择符、伪类、伪元素和层叠顺序的入门。 CSS 属性 各种层叠样式表级别一有效的属性的描述。 将样式表加入到HTML中 各种将样式表加入到HTML文本中的方法。 依赖样式表 怎样会是滥用...
js+css网站通用的树形结构
中文翻译为样式表! 它的作用简单的说:就是可以使你在同一页面里使用不同的超链接样式。更神奇的是,用CSS,仅仅改变一个文件就可以...CSS 速成\CSS 结构和规则\CSS 属性\将样式表加入到HTML中 \依赖样式表 \CSS 参考
CSS 速成 CSS 结构和规则 CSS 属性 将样式表加入到HTML中 依赖样式表 CSS 参考
包含CSS速成、CSS结构和规则、CSS属性以及各种将样式表加入到HTML文本中的方法。
新闻发布系统,div+css结构的新闻系统.推荐下载使用.