解读Blueprint CSS framework(二)

2014-11-24 10:34:57 · 作者: · 浏览: 1
--- */

/*和平时的做法不一样,常用的ul li是有margin的,并保留list-style*/
li ul,
li ol { margin:0 1.5em; }
ul, ol { margin: 0 1.5em 1.5em 1.5em; }

ul { list-style-type: disc; }
ol { list-style-type: decimal; }

dl { margin: 0 0 1.5em 0; }
dl dt { font-weight: bold; }
dd { margin-left: 1.5em;}


/* Tables
-------------------------------------------------------------- */
/*表格头加粗加背景,效果应该不错*/
table { margin-bottom: 1.4em; width:100%; }
th { font-weight: bold; }
thead th { background: #c3d9ff; }
th,td,caption { padding: 4px 10px 4px 5px; }
tr.even td { background: #e5ecf9; }
tfoot { font-style: italic; }
caption { background: #eee; }


/* Misc classes
-------------------------------------------------------------- */

.small { font-size: .8em; margin-bottom: 1.875em; line-height: 1.875em; }
.large { font-size: 1.2em; line-height: 2.5em; margin-bottom: 1.25em; }
.hide { display: none; }

.quiet { color: #666; }
.loud { color: #000; }
.highlight { background:#ff0; }
.added { background:#060; color: #fff; }
.removed { background:#900; color: #fff; }

.first { margin-left:0; padding-left:0; }
.last { margin-right:0; padding-right:0; }
.top { margin-top:0; padding-top:0; }
.bottombottom { margin-bottom:0; padding-bottom:0; }

表单

CSS代码
/* --------------------------------------------------------------

forms.css
* Sets up some default styling for forms
* Gives you classes to enhance your forms

Usage:
* For text fields, use class .title or .text
* For inline forms, use .inline (even when using columns)

-------------------------------------------------------------- */

label { font-weight: bold; }
fieldset { padding:1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; }
legend { font-weight: bold; font-size:1.2em; }


/* Form fields
-------------------------------------------------------------- */
/*这种方式的selector不错*/
input[type=text], input[type=password],
input.text, input.title,
textarea, select {
background-color:#fff;
border:1px solid #bbb;
}
/*获取到焦点时改变边框颜色,不用JS就能实现,很实用*/
input[type=text]:focus, input[type=password]:focus,
input.text:focus, input.title:focus,
textarea:focus, select:focus {
border-color:#666;
}

input[type=text], input[type=password],
input.text, input.title,
textarea, select {
margin:0.5em 0;
}

input.text,
input.title { width: 300px; padding:5px; }
input.title { font-size:1.5em; }
textarea { width: 390px; height: 250px; padding:5px; }
/*修正checkbox和radio的位置*/
input[type=checkbox], input[type=radio],
input.checkbox, input.radio {
position:relative; top:.25em;
}

form.inline { line-height:3; }
form.inline p { margin-bottom:0; }


/* Success, notice and error boxes
-------------------------------------------------------------- */

.error,
.notice,
.success { padding: .8em; margin-bottom: 1em; border: 2px solid #ddd; }

.error { background: #FBE3E4; color: #8a1f11; border-color: #FBC2C4; }
.notice { background: #FFF6BF; color: #514721; border-color: #FFD324; }
.success { background: #E6EFC2; color: #264409; border-color: #C6D880; }
.error a { color: #8a1