webkit內核瀏覽器的CSS寫法

-webkit-tap-highlight-color: transparent; Mobile上點擊連接高亮的時候設置顏色爲透明web

-webkit-user-select: none; 設置爲沒法選擇文本canvas

-webkit-touch-callout: none; 長按時不觸發系統的菜單, 可用在圖片上加這個屬性禁止下載圖片瀏覽器

:-webkit-full-screen canvas {} 全屏模式時的樣式(for Desktop)app

div p :matches(em, b, strong) {} 使用mathes來匹配多個選擇器this

@media only screen and (max-width: 480px) {} 指定Mobile設備或者小屏幕桌面屏幕url

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 300dpi) { 指定高分辨率屏幕設備spa

header { background-image: url(header-highres.png); }orm

}圖片

@media (-webkit-max-device-pixel-ratio: 1.5),(max-resolution: 299dpi) { 指定低分辨率屏幕設備ip

header { background-image: url(header-lowres.png); }

}

background-repeat:  space; background-repeat: round; 這兩種CSS3的背景屬性值得研究

width: calc(100%-40px); 計算寬度

text-decoration: #FF8800  wavy ine-through; 波浪型連接

text-rendering: optimizeLegibility; 用這個屬性以後會收緊字符間的距離

font-variant-ligatures:  common-ligatures; 設置CSS連字

transform:  rotate(90); 旋轉90度

transform-origin: center center; transform-origin能夠改變變換的位置

-webkit-appearance: none; -webkit-appearance能夠改變按鈕或者其它控件看起來相似本地的控件

美化表單校驗時的提示樣式

::-webkit-validation-bubble {}

::-webkit-validation-bubble-message {}

::-webkit-validation-bubble-arrow {}

::-webkit-validation-bubble-arrow-clipper {}當提示出現時相似於下面的結構

<div -webkit-validation-bubble>

<div -webkit-validation-bubble-arrow></div>

<div -webkit-validation-bubble-arrow-clipper></div>

<div -webkit-validation-bubble-message>Error Message</div>

</div>自定義webkit瀏覽器的滾動條, 見Google Reader等在Chrome/Safari下的效果, 下面是一個實例, 這個滾動條的樣式代碼以下:

Customized WebKit Scrollbar /* Let´s get this party started */

::-webkit-scrollbar {

width: 12px;

}

/* Track */

::-webkit-scrollbar-track {

-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);

-webkit-border-radius: 10px;

border-radius: 10px;

}

/* Handle */

::-webkit-scrollbar-thumb {

-webkit-border-radius: 10px;

border-radius: 10px;

background: rgba(255,0,0,0.8);

-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);

}

::-webkit-scrollbar-thumb:window-inactive {

background: rgba(255,0,0,0.4);

}-webkit-background-composite: plus-darker; -webkit-background-composite用來設置一個元素的背景或顏色的組合樣式

-webkit-text-stroke:  1px rgba(0,0,0,0.5); -webkit-text-stroke能夠用來給文字添加描邊

-webkit-mask-image:  url(/path/to/mask.png); 定義一個圖片用來遮罩元素

-webkit-box-reflect:  below 5px; 定義了一個元素的反射

:local-link {font-weight: normal;}  local-link能夠定義相對地址的連接樣式

相關文章
相關標籤/搜索