white-space:nowrap;
多行文本最後省略號:javascript
display: -webkit-box; -webkit-line-clamp:2; overflow: hidden; -webkit-box-orient: vertical; text-overflow: ellipsis;
text-overflow:ellipsis;
(注:text-overflow:clip | ellipsis | ellipsis-word;(css3新增長的)
其中clip表示直接裁切溢出的文本;
值ellipsis表示文本溢出時,顯示省略標記(...),省略標記代替最後一個字符;
值ellipsis-word表示文本溢出時,也是顯示省略標記(...),不一樣的是,省略標記代替的是最後一個詞)php
當點擊a標籤裏面的圖片的時候,有虛線框,IE中圖片還有邊框,如何解決?
解決辦法:css
a{outline:none;}//主要是針對火狐等瀏覽器,但IE不行 img{border:0;} a:active{noOutline:expression(this.onFocus=this.blur());}//解決IE6,IE7中的虛線框。
對於a標籤來講,通常簡單的解決辦法是:
在a標籤里加入js控制,當a標籤被聚焦時,強制取消焦點,這時候a標籤天然不會有虛線框。html
<a href="#"onfocus="this.blur();">測試</a>
可是當鏈接太多的時候,一個一個的加這段代碼不實用java
例如:div 寬300px ; img 寬100px; border:0px;android
<div><img /><img /><img /></div>
//上面狀況恰好顯示三張圖ios
<div><img /><img /><img /></div>
這種狀況就沒法在橫向顯示三張圖,由於回車致使兩圖間有間隙。
解決辦法就是讓圖片浮動。css3
產生緣由:
當父元素的直接子元素或者下級子元素的樣式擁有position:relative 屬性時,父元素的overflow:hidden 屬性就會失效。web
解決辦法:
咱們在IE 六、7 內發現子元素會超出父元素設定的高度,即便父元素設置了overflow:hidden。
解決這個bug很簡單,在父元素中使用 *position:relative; 便可解決該bugchrome
<table aling=left>...</table>表格位置,置左
<table aling=center>...</table>表格位置,置中
<table background=圖片路徑>...</table>背景圖片的URL=就是路徑網址
<table border=邊框大小>...</table>設定表格邊框大小(使用數字)
<table bgcolor=顏色碼>...</table>設定表格的背景顏色
<table borderclor=顏色碼>...</table>設定表格邊框的顏色
<table borderclordark=顏色碼>...</table>設定表格暗邊框的顏色
<table borderclorlight=顏色碼>...</table>設定表格亮邊框的顏色
<table cellpadding=參數>...</table>指定內容與格線之間的間距(使用數字)
<table cellspacing=參數>...</table>指定格線與格線之間的距離(使用數字)
<table cols=參數>...</table>指定表格的欄數
<table frame=參數>...</table>設定表格外框線的顯示方式
<table width=寬度>...</table>指定表格的寬度大小(使用數字)
<table height=高度>...</table>指定表格的高度大小(使用數字)
<td colspan=參數>...</td>指定儲存格合併欄的欄數(使用數字)
<td rowspan=參數>...</td>指定儲存格合併列的列數(使用數字)
text-transform 屬性控制文本的大小寫。
none 默認。定義帶有小寫字母和大寫字母的標準的文本。
capitalize 文本中的每一個單詞以大寫字母開頭。
uppercase 定義僅有大寫字母。
lowercase 定義無大寫字母,僅有小寫字母。
inherit 規定應該從父元素繼承 text-transform 屬性的值。
letter-spacing 屬性增長或減小字符間的空白(字符間距)。
例如: letter-spacing: 2px;
代碼:
<TEXTAREA style= "overflow:hidden; resize:none; "> </TEXTAREA>
filter: alpha(opacity=80);opacity:0.8;
a. 用css中的type選擇器
input[type="text"]{ }
b.用css的expression判斷表達式
input{ }
c.用javascript腳本實現(以爲不必,省略...)
[ text-stroke-width ]:設置或檢索對象中的文字的描邊厚度 [ text-stroke-color ]:設置或檢索對象中的文字的描邊顏色
text-stroke(文本描邊)和text-fill-color(文本填充色)注意點:
目前這兩個屬性只有webkit內核的Safari和Chrome支持,例如: -webkit-text-stroke: 3.3px #2A75BF;
text-fill-color:顏色值,和color屬性差很少都是文字的樣式;
同時使用text-fill-color和color屬性,text-fill-color將覆蓋color屬性的顏色值;
text-fill-color可使用透明值,即:text-fill-color:transparent
text-shadow:0px 0px 0px #333333;
屬性值依次:水平方向位移(支持負值)、垂直方向位移(支持負值)、模糊半徑、陰影顏色
text-shadow對同一個text,可設置多個陰影,與box-shadow相似,使用逗號","分割,前一個設置效果在後一個設置效果之上。
box-shadow 參考:http://www.cnblogs.com/lhb25/archive/2013/02/20/css3-box-shadow.html
<style> @font-face { font-family: myFirstFont; src: url('Sansation_Light.ttf'), url('Sansation_Light.eot'); /* IE9+ */ } div { font-family:myFirstFont; } </style>
{ word-break:break-all; /*支持IE,chrome,FF不支持*/ word-wrap:break-word;/*支持IE,chrome,FF*/ }
:nth-child(2)選取第幾個標籤,「2能夠是你想要的數字」
:nth-child(2n)選取偶數標籤,2n也能夠是even
:nth-child(2n-1)選取奇數標籤,2n-1能夠是odd
:nth-child(3n+1)自定義選取標籤,3n+1表示「隔二取一」
background:-webkit-linear-gradient(top,#FFF,#cb1919); background:-o-linear-gradient(top,#FFF,#cb1919); background:-ms-linear-gradient(top,#FFF,#cb1919); background:-moz-linear-gradient(top,#FFF,#cb1919); background:linear-gradient(top,#FFF,#cb1919);
第一個參數:設置漸變的起始位置
第二個參數:設置起始位置的顏色
第三個參數:設置終止位置的顏色
IE 瀏覽器
IE瀏覽器實現漸變只能使用IE本身的濾鏡去實現
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#00ffff,endColorstr=#9fffff,grandientType=1);
第一個參數:漸變起始位置的顏色
第二個參數:漸變終止位置的顏色
第三個參數:漸變的類型
0 表明豎向漸變 1 表明橫向漸變
font-size: 17px; border-radius: 6px; color: rgb(255, 255, 255); font-family: 微軟雅黑, 宋體, 黑體, Arial; height: 26px; line-height: 25px; text-shadow: rgb(34, 34, 34) 2px 2px 3px; margin: 12px 0px !important; background: rgb(119, 119, 119);">19.初始化em,u的斜體
em,u{font-style: normal;}
-webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none;
@media screen and (max-width: 960px){ body{ background: #000; } }
@media (max-width: 960px){ body{ background: #000; } }
@media (max-device-height:480px) and (-webkit-min-device-pixel-ratio:2){
//本身添加的樣式
}
其中對於-webkit-min-device-pixel-ratio做以下解釋:
input::-webkit-input-placeholder{color:#AAAAAA;} input:focus::-webkit-input-placeholder{color:#EEEEEE;}
/* WebKit browsers */::-webkit-input-placeholder {color: #777;}
/* Mozilla Firefox 4 to 18 */:-moz-placeholder {color: #777;opacity: 1;}
/* Mozilla Firefox 19+ */::-moz-placeholder {color: #777;opacity: 1;}
/* Internet Explorer 10+ */:-ms-input-placeholder {color: #777;}
- 谷歌瀏覽器(Webkit): ::-webkit-input-placeholder pseudo-element;
- IE10: :-ms-input-placeholder pseudo-class;
- 火狐瀏覽器(Gecko18-): :-moz-placeholder pseudo-class;
- 火狐瀏覽器(Gecko19+): ::-moz-placeholder pseudo-element;
- Opera(Presto): 無。
-webkit-appearance:none;
-webkit-tap-highlight-color:rgba(0, 0, 0, 0); /* 取消連接高亮 */
/* 設置滾動條的樣式 */ - ::-webkit-scrollbar { - width:12px; - } - /* 滾動槽 */ - ::-webkit-scrollbar-track { - -webkit-box-shadow:inset006pxrgba(0,0,0,0.3); - border-radius:10px; - } - /* 滾動條滑塊 */ - ::-webkit-scrollbar-thumb { - border-radius:10px; - background:rgba(0,0,0,0.1); - -webkit-box-shadow:inset006pxrgba(0,0,0,0.5); - } - ::-webkit-scrollbar-thumb:window-inactive { - background:rgba(255,0,0,0.4); - }
div{height:100%;overflow-y:auto;}
-webkit-overflow-scrolling:touch;
-webkit-transform:translate3d(0,0,0);
position:absolute; left:50%; bottom:0; margin-left:-10px; width:0; height:0; border-width:10px; border-style:solid dashed dashed dashed; border-color:transparent transparent #71151c transparent;
display: -webkit-box; -webkit-line-clamp: 4; overflow: hidden; text-overflow: ellipsis; -webkit-box-orient: vertical;
display: box; display: -webkit-box; display: -moz-box; -webkit-box-pack:center; -moz-box-pack:center; -webkit-box-align:center; -moz-box-align:center;
outline:medium;
body{font-family:Helvetica;}
.css{-webkit-touch-callout: none}
.css{-webkit-user-select:none}
打電話:<a href="tel:0755-10086">打電話給:0755-10086</a>
發短信:winphone系統無效,<a href="sms:10086">發短信給: 10086</a>
發郵件:<a href="mailTo:10086@qq.com">10086@qq.com</a>
-webkit-filter是css3的一個屬性,Webkit率先支持了這幾個功能,感受效果很不錯。下面我們就學習一下filter這個屬性吧。
如今規範中支持的效果有:
用法是標準的CSS寫法,如:
使用方法:(配合動畫使用)
.jaguar-con-show img.jaguar-con-imglast{ -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -o-transition: all 0.3s ease-in-out; -ms-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out; } .jaguar-con-show img.jaguar-con-imglast{ -webkit-filter: blur(3px) brightness(.6); -moz-filter: blur(3px) brightness(.6); -o-filter: blur(3px) brightness(.6); -ms-filter: blur(3px) brightness(.6); filter: blur(3px) brightness(.5); -webkit-transform:scale(1.1,1.1); -moz-transform:scale(1.1,1.1); /*border: 3px solid #000;*/ }