| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -217,3 +217,334 @@ td,th { | |||
| 217 | 217 | overflow: visible; | |
| 218 | 218 | padding: .5em 1em | |
| 219 | 219 | } | |
| 220 | + | ||
| 221 | + | ||
| 222 | + | ||
| 223 | + /* 如果你的项目仅支持 IE9+ | Chrome | Firefox 等,推荐在 <html> 中添加 .borderbox 这个 class */ | ||
| 224 | + html.borderbox *, html.borderbox *:before, html.borderbox *:after { | ||
| 225 | + -moz-box-sizing: border-box; | ||
| 226 | + -webkit-box-sizing: border-box; | ||
| 227 | + box-sizing: border-box; | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + /* 重设 HTML5 标签, IE 需要在 js 中 createElement(TAG) */ | ||
| 231 | + article, aside, details, figcaption, figure, footer, header, menu, nav, section { | ||
| 232 | + display: block; | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + /* HTML5 媒体文件跟 img 保持一致 */ | ||
| 236 | + audio, canvas, video { | ||
| 237 | + display: inline-block; | ||
| 238 | + } | ||
| 239 | + | ||
| 240 | + /* 要注意表单元素并不继承父级 font 的问题 */ | ||
| 241 | + body, button, input, select, textarea { | ||
| 242 | + font: 300 1em/1.8 PingFang SC, Lantinghei SC, Microsoft Yahei, Hiragino Sans GB, Microsoft Sans Serif, WenQuanYi Micro Hei, sans-serif; | ||
| 243 | + } | ||
| 244 | + | ||
| 245 | + button::-moz-focus-inner, | ||
| 246 | + input::-moz-focus-inner { | ||
| 247 | + padding: 0; | ||
| 248 | + border: 0; | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + /* 去掉各Table cell 的边距并让其边重合 */ | ||
| 252 | + table { | ||
| 253 | + border-collapse: collapse; | ||
| 254 | + border-spacing: 0; | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + /* 去除默认边框 */ | ||
| 258 | + fieldset, img { | ||
| 259 | + border: 0; | ||
| 260 | + } | ||
| 261 | + | ||
| 262 | + /* 块/段落引用 */ | ||
| 263 | + blockquote { | ||
| 264 | + position: relative; | ||
| 265 | + color: #999; | ||
| 266 | + font-weight: 400; | ||
| 267 | + border-left: 1px solid #1abc9c; | ||
| 268 | + padding-left: 1em; | ||
| 269 | + margin: 1em 3em 1em 2em; | ||
| 270 | + } | ||
| 271 | + | ||
| 272 | + @media only screen and ( max-width: 640px ) { | ||
| 273 | + blockquote { | ||
| 274 | + margin: 1em 0; | ||
| 275 | + } | ||
| 276 | + } | ||
| 277 | + | ||
| 278 | + /* Firefox 以外,元素没有下划线,需添加 */ | ||
| 279 | + acronym, abbr { | ||
| 280 | + border-bottom: 1px dotted; | ||
| 281 | + font-variant: normal; | ||
| 282 | + } | ||
| 283 | + | ||
| 284 | + /* 添加鼠标问号,进一步确保应用的语义是正确的(要知道,交互他们也有洁癖,如果你不去掉,那得多花点口舌) */ | ||
| 285 | + abbr { | ||
| 286 | + cursor: help; | ||
| 287 | + } | ||
| 288 | + | ||
| 289 | + /* 一致的 del 样式 */ | ||
| 290 | + del { | ||
| 291 | + text-decoration: line-through; | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + address, caption, cite, code, dfn, em, th, var { | ||
| 295 | + font-style: normal; | ||
| 296 | + font-weight: 400; | ||
| 297 | + } | ||
| 298 | + | ||
| 299 | + /* 去掉列表前的标识, li 会继承,大部分网站通常用列表来很多内容,所以应该当去 */ | ||
| 300 | + ul, ol { | ||
| 301 | + list-style: none; | ||
| 302 | + } | ||
| 303 | + | ||
| 304 | + /* 对齐是排版最重要的因素, 别让什么都居中 */ | ||
| 305 | + caption, th { | ||
| 306 | + text-align: left; | ||
| 307 | + } | ||
| 308 | + | ||
| 309 | + q:before, q:after { | ||
| 310 | + content: ''; | ||
| 311 | + } | ||
| 312 | + | ||
| 313 | + /* 统一上标和下标 */ | ||
| 314 | + sub, sup { | ||
| 315 | + font-size: 75%; | ||
| 316 | + line-height: 0; | ||
| 317 | + position: relative; | ||
| 318 | + } | ||
| 319 | + | ||
| 320 | + :root sub, :root sup { | ||
| 321 | + vertical-align: baseline; /* for ie9 and other modern browsers */ | ||
| 322 | + } | ||
| 323 | + | ||
| 324 | + sup { | ||
| 325 | + top: -0.5em; | ||
| 326 | + } | ||
| 327 | + | ||
| 328 | + sub { | ||
| 329 | + bottom: -0.25em; | ||
| 330 | + } | ||
| 331 | + | ||
| 332 | + /* 让链接在 hover 状态下显示下划线 */ | ||
| 333 | + a { | ||
| 334 | + color: #1abc9c; | ||
| 335 | + } | ||
| 336 | + | ||
| 337 | + a:hover { | ||
| 338 | + text-decoration: underline; | ||
| 339 | + } | ||
| 340 | + | ||
| 341 | + a { | ||
| 342 | + border-bottom: 1px solid #1abc9c; | ||
| 343 | + } | ||
| 344 | + | ||
| 345 | + a:hover { | ||
| 346 | + border-bottom-color: #555; | ||
| 347 | + color: #555; | ||
| 348 | + text-decoration: none; | ||
| 349 | + } | ||
| 350 | + | ||
| 351 | + /* 默认不显示下划线,保持页面简洁 */ | ||
| 352 | + ins, a { | ||
| 353 | + text-decoration: none; | ||
| 354 | + } | ||
| 355 | + | ||
| 356 | + /* 专名号:虽然 u 已经重回 html5 Draft,但在所有浏览器中都是可以使用的, | ||
| 357 | + * 要做到更好,向后兼容的话,添加 class="typo-u" 来显示专名号 | ||
| 358 | + * 关于 <u> 标签:http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-u-element | ||
| 359 | + * 被放弃的是 4,之前一直搞错 http://www.w3.org/TR/html401/appendix/changes.html#idx-deprecated | ||
| 360 | + * 一篇关于 <u> 标签的很好文章:http://html5doctor.com/u-element/ | ||
| 361 | + */ | ||
| 362 | + u, .typo-u { | ||
| 363 | + text-decoration: underline; | ||
| 364 | + } | ||
| 365 | + | ||
| 366 | + /* 标记,类似于手写的荧光笔的作用 */ | ||
| 367 | + mark { | ||
| 368 | + background: #fffdd1; | ||
| 369 | + border-bottom: 1px solid #ffedce; | ||
| 370 | + padding: 2px; | ||
| 371 | + margin: 0 5px; | ||
| 372 | + } | ||
| 373 | + | ||
| 374 | + /* 代码片断 */ | ||
| 375 | + pre, code, pre tt { | ||
| 376 | + font-family: Courier, 'Courier New', monospace; | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | + pre { | ||
| 380 | + background: #f8f8f8; | ||
| 381 | + border: 1px solid #ddd; | ||
| 382 | + padding: 1em 1.5em; | ||
| 383 | + display: block; | ||
| 384 | + -webkit-overflow-scrolling: touch; | ||
| 385 | + } | ||
| 386 | + | ||
| 387 | + /* 一致化 horizontal rule */ | ||
| 388 | + hr { | ||
| 389 | + border: none; | ||
| 390 | + border-bottom: 1px solid #cfcfcf; | ||
| 391 | + margin-bottom: 0.8em; | ||
| 392 | + height: 10px; | ||
| 393 | + } | ||
| 394 | + | ||
| 395 | + /* 底部印刷体、版本等标记 */ | ||
| 396 | + small, .typo-small, | ||
| 397 | + /* 图片说明 */ | ||
| 398 | + figcaption { | ||
| 399 | + font-size: 0.9em; | ||
| 400 | + color: #888; | ||
| 401 | + } | ||
| 402 | + | ||
| 403 | + strong, b { | ||
| 404 | + font-weight: bold; | ||
| 405 | + color: #000; | ||
| 406 | + } | ||
| 407 | + | ||
| 408 | + /* 可拖动文件添加拖动手势 */ | ||
| 409 | + [draggable] { | ||
| 410 | + cursor: move; | ||
| 411 | + } | ||
| 412 | + | ||
| 413 | + .clearfix:before, .clearfix:after { | ||
| 414 | + content: ""; | ||
| 415 | + display: table; | ||
| 416 | + } | ||
| 417 | + | ||
| 418 | + .clearfix:after { | ||
| 419 | + clear: both; | ||
| 420 | + } | ||
| 421 | + | ||
| 422 | + .clearfix { | ||
| 423 | + zoom: 1; | ||
| 424 | + } | ||
| 425 | + | ||
| 426 | + /* 强制文本换行 */ | ||
| 427 | + .textwrap, .textwrap td, .textwrap th { | ||
| 428 | + word-wrap: break-word; | ||
| 429 | + word-break: break-all; | ||
| 430 | + } | ||
| 431 | + | ||
| 432 | + .textwrap-table { | ||
| 433 | + table-layout: fixed; | ||
| 434 | + } | ||
| 435 | + | ||
| 436 | + /* 提供 serif 版本的字体设置: iOS 下中文自动 fallback 到 sans-serif */ | ||
| 437 | + .serif { | ||
| 438 | + font-family: Palatino, Optima, Georgia, serif; | ||
| 439 | + } | ||
| 440 | + | ||
| 441 | + /* 保证块/段落之间的空白隔行 */ | ||
| 442 | + p, pre, ul, ol, dl, form, hr, table, | ||
| 443 | + .typo-p, .typo-pre, .typo-ul, .typo-ol, .typo-dl, .typo-form, .typo-hr, .typo-table, blockquote { | ||
| 444 | + margin-bottom: 1.2em | ||
| 445 | + } | ||
| 446 | + | ||
| 447 | + h1, h2, h3, h4, h5, h6 { | ||
| 448 | + font-family: PingFang SC, Verdana, Helvetica Neue, Microsoft Yahei, Hiragino Sans GB, Microsoft Sans Serif, WenQuanYi Micro Hei, sans-serif; | ||
| 449 | + font-weight: 100; | ||
| 450 | + color: #000; | ||
| 451 | + line-height: 1.35; | ||
| 452 | + } | ||
| 453 | + | ||
| 454 | + /* 标题应该更贴紧内容,并与其他块区分,margin 值要相应做优化 */ | ||
| 455 | + h1, h2, h3, h4, h5, h6, | ||
| 456 | + .typo-h1, .typo-h2, .typo-h3, .typo-h4, .typo-h5, .typo-h6 { | ||
| 457 | + margin-top: 1.2em; | ||
| 458 | + margin-bottom: 0.6em; | ||
| 459 | + line-height: 1.35; | ||
| 460 | + } | ||
| 461 | + | ||
| 462 | + h1, .typo-h1 { | ||
| 463 | + font-size: 2em; | ||
| 464 | + } | ||
| 465 | + | ||
| 466 | + h2, .typo-h2 { | ||
| 467 | + font-size: 1.8em; | ||
| 468 | + } | ||
| 469 | + | ||
| 470 | + h3, .typo-h3 { | ||
| 471 | + font-size: 1.6em; | ||
| 472 | + } | ||
| 473 | + | ||
| 474 | + h4, .typo-h4 { | ||
| 475 | + font-size: 1.4em; | ||
| 476 | + } | ||
| 477 | + | ||
| 478 | + h5, h6, .typo-h5, .typo-h6 { | ||
| 479 | + font-size: 1.2em; | ||
| 480 | + } | ||
| 481 | + | ||
| 482 | + /* 在文章中,应该还原 ul 和 ol 的样式 */ | ||
| 483 | + ul, .typo-ul { | ||
| 484 | + margin-left: 1.3em; | ||
| 485 | + list-style: disc; | ||
| 486 | + } | ||
| 487 | + | ||
| 488 | + ol, .typo-ol { | ||
| 489 | + list-style: decimal; | ||
| 490 | + margin-left: 1.9em; | ||
| 491 | + } | ||
| 492 | + | ||
| 493 | + li ul, li ol, .typo-ul ul, .typo-ul ol, .typo-ol ul, .typo-ol ol { | ||
| 494 | + margin-bottom: 0.8em; | ||
| 495 | + margin-left: 2em; | ||
| 496 | + } | ||
| 497 | + | ||
| 498 | + li ul, .typo-ul ul, .typo-ol ul { | ||
| 499 | + list-style: circle; | ||
| 500 | + } | ||
| 501 | + | ||
| 502 | + /* 同 ul/ol,在文章中应用 table 基本格式 */ | ||
| 503 | + table th, table td, .typo-table th, .typo-table td, table caption { | ||
| 504 | + border: 1px solid #ddd; | ||
| 505 | + padding: 0.5em 1em; | ||
| 506 | + color: #666; | ||
| 507 | + } | ||
| 508 | + | ||
| 509 | + table th, .typo-table th { | ||
| 510 | + background: #fbfbfb; | ||
| 511 | + } | ||
| 512 | + | ||
| 513 | + table thead th, .typo-table thead th { | ||
| 514 | + background: #f1f1f1; | ||
| 515 | + } | ||
| 516 | + | ||
| 517 | + table caption { | ||
| 518 | + border-bottom: none; | ||
| 519 | + } | ||
| 520 | + | ||
| 521 | + /* 去除 webkit 中 input 和 textarea 的默认样式 */ | ||
| 522 | + .typo-input, .typo-textarea { | ||
| 523 | + -webkit-appearance: none; | ||
| 524 | + border-radius: 0; | ||
| 525 | + } | ||
| 526 | + | ||
| 527 | + .typo-em, em, legend, caption { | ||
| 528 | + color: #000; | ||
| 529 | + font-weight: inherit; | ||
| 530 | + } | ||
| 531 | + | ||
| 532 | + /* 着重号,只能在少量(少于100个字符)且全是全角字符的情况下使用 */ | ||
| 533 | + .typo-em { | ||
| 534 | + position: relative; | ||
| 535 | + } | ||
| 536 | + | ||
| 537 | + .typo-em:after { | ||
| 538 | + position: absolute; | ||
| 539 | + top: 0.65em; | ||
| 540 | + left: 0; | ||
| 541 | + width: 100%; | ||
| 542 | + overflow: hidden; | ||
| 543 | + white-space: nowrap; | ||
| 544 | + content: "・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・"; | ||
| 545 | + } | ||
| 546 | + | ||
| 547 | + /* Responsive images */ | ||
| 548 | + img { | ||
| 549 | + max-width: 100%; | ||
| 550 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments