自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

分享10個(gè)很實(shí)用的CSS的代碼片段

開(kāi)發(fā) 前端
以下是10個(gè)來(lái)自于網(wǎng)絡(luò)收集的非常實(shí)用且重要的CSS代碼片段。

 介紹

以下是10個(gè)來(lái)自于網(wǎng)絡(luò)收集的非常實(shí)用且重要的CSS代碼片段

 

 

 

 

CSS重置

這是CSS瀏覽器重置的基本和常見(jiàn)的CSS代碼段

 

  1. html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { 
  2.      margin: 0; 
  3.      padding: 0; 
  4.      border: 0; 
  5.      font-size: 100%; 
  6.      font: inherit; 
  7.      vertical-align: baseline; 
  8.      outline: none; 
  9.      -webkit-box-sizing: border-box; 
  10.      -moz-box-sizing: border-box; 
  11.      box-sizing: border-box; 
  12.  html { 
  13.      height: 101%; 
  14.  body { 
  15.      font-size: 62.5%; 
  16.      line-height: 1; 
  17.      font-family: Arial, Tahoma, sans-serif; 
  18.  article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { 
  19.      display: block; 
  20.  ol, ul { 
  21.      list-style: none; 
  22.  blockquote, q { 
  23.      quotes: none; 
  24.  blockquote:before, blockquote:after, q:before, q:after { 
  25.      content: ''
  26.      content: none; 
  27.  strong { 
  28.      font-weight: bold; 
  29.  table { 
  30.      border-collapse: collapse; 
  31.      border-spacing: 0; 
  32.  img { 
  33.      border: 0; 
  34.      max-width: 100%; 
  35.  p { 
  36.      font-size: 1.2em; 
  37.      line-height: 1.0em; 
  38.      color: #333; 

跨瀏覽器透明度設(shè)置

  1. .transparent {     
  2.      -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";/* IE 8 */     
  3.      filter: alpha(opacity=50); /* IE 5-7 */     
  4.      -moz-opacity: 0.5;/* Netscape */     
  5.      -khtml-opacity: 0.5; /* Safari 1.x */    
  6.      opacity: 0.5;  /* Good browsers */ 

 

常規(guī)媒體查詢

 

  1. /* Smartphones (portrait and landscape) ----------- */ 
  2.  @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { 
  3.     
  4. /* Smartphones (landscape) ----------- */ 
  5.  @media only screen and (min-width : 321px) { 
  6.     
  7. /* Smartphones (portrait) ----------- */ 
  8.  @media only screen and (max-width : 320px) { 
  9.      
  10. /* iPads (portrait and landscape) ----------- */ 
  11.  @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { 
  12.      
  13. /* iPads (landscape) ----------- */ 
  14.  @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { 
  15.      
  16. /* iPads (portrait) ----------- */ 
  17.  @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { 
  18.      
  19. /* Desktops and laptops ----------- */ 
  20.  @media only screen and (min-width : 1224px) { 
  21.     
  22. /* Large screens ----------- */ 
  23.  @media only screen and (min-width : 1824px) { 
  24.      
  25. /* iPhone 4 ----------- */ 
  26.  @media only screen and (-webkit-min-device-pixel-ratio:1.5), only screen and (min-device-pixel-ratio:1.5) { 
  27.     

 

自定義選中文本

 

  1. ::selection { 
  2.      background: #51a351; 
  3.  ::-moz-selection { 
  4.      background: #51a351; 
  5.  ::-webkit-selection { 
  6.      background: #51a351; 

 

帶CSS3的全屏背景

 

  1. html { 
  2.      background: url('images/bg.jpg'no-repeat center center fixed; 
  3.      -webkit-background-size: cover; 
  4.      -moz-background-size: cover; 
  5.      -o-background-size: cover; 
  6.      background-size: cover; 

 

強(qiáng)制垂直滾動(dòng)條

  1. html { 
  2.      height: 101%  

文本首字母大寫(xiě)

 

  1. p:first-letter { 
  2.      display: block; 
  3.      margin: 4px 0 0 4px; 
  4.      floatleft
  5.      color: #ff3366; 
  6.      font-size: 5.3em; 
  7.      font-family: Georgia, Times New Roman, serif; 

 

內(nèi)外陰影

 

  1. #mydiv { 
  2.      -moz-box-shadow: inset 2px 0 4px #000; 
  3.      -webkit-box-shadow: inset 2px 0 4px #000; 
  4.      box-shadow: inset 2px 0 4px #000; 

 

 

  1. #mydiv { 
  2.      -webkit-box-shadow: 0 2px 2px -2px rgba(0, 0, 0, 0.52); 
  3.      -moz-box-shadow: 0 2px 2px -2px rgba(0, 0, 0, 0.52); 
  4.      box-shadow: 0 2px 2px -2px rgba(0, 0, 0, 0.52); 

 

語(yǔ)音氣泡

 

  1. .speech-bubble { 
  2.     position: relative
  3.     background: #00aabb; 
  4.     border-radius: .4em; 
  5.   
  6. .speech-bubble:after { 
  7.     content: ''
  8.     position: absolute
  9.     bottom: 0; 
  10.     left: 50%; 
  11.     width: 0; 
  12.     height: 0; 
  13.     border: 30px solid transparent; 
  14.     border-top-color: #00aabb; 
  15.     border-bottom: 0; 
  16.     border-left: 0; 
  17.     margin-left: -15px; 
  18.     margin-bottom: -30px; 

 

自定義輸入樣式

 

  1. input[type=text], textarea { 
  2.      -webkit-transition: all 0.30s ease-in-out
  3.      -moz-transition: all 0.30s ease-in-out
  4.      -ms-transition: all 0.30s ease-in-out
  5.      -o-transition: all 0.30s ease-in-out
  6.      outline: none; 
  7.      padding: 3px 0px 3px 3px; 
  8.      margin: 5px 1px 3px 0px; 
  9.      border: 1px solid #ddd; 
  10.  input[type=text]:focus, textarea:focus { 
  11.      box-shadow: 0 0 5px rgba(81, 203, 238, 1); 
  12.      padding: 3px 0px 3px 3px; 
  13.      margin: 5px 1px 3px 0px; 
  14.      border: 1px solid rgba(81, 203, 238, 1); 

 

責(zé)任編輯:華軒 來(lái)源: 今日頭條
相關(guān)推薦

2011-07-07 10:35:53

htaccess

2015-10-08 08:53:46

PHP代碼片段

2011-07-14 10:07:19

PHP

2021-09-17 15:31:47

代碼JavaScript數(shù)組

2012-11-27 10:23:18

CSSWeb開(kāi)發(fā)

2015-11-02 09:25:07

jQuery代碼片段

2021-10-31 07:36:17

前端JavaScript編程

2011-11-23 09:21:43

jQuery

2011-07-11 10:16:07

JavaScript

2023-06-16 16:34:25

JavaScripWeb 開(kāi)發(fā)

2023-11-03 16:02:00

JavaScript開(kāi)發(fā)

2024-01-04 16:46:58

JavaScript開(kāi)發(fā)

2024-04-09 00:00:00

Java代碼片段

2015-10-29 10:30:41

C#程序員實(shí)用代碼

2015-08-19 09:15:11

C#程序員實(shí)用代碼

2014-07-09 09:13:16

Web效果Web特效

2025-01-08 08:53:05

2022-06-08 08:55:15

JavaScript代碼前端

2019-10-10 16:49:18

Python鏡音雙子腳本語(yǔ)言

2012-02-07 14:04:53

CSS
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)