CSS 原來可以這樣寫(一)

轉(zhuǎn)自:小月博客 http://www.aliyue.net/652.html


1. 文字換行

/*強(qiáng)制不換行*/

white-space:nowrap;

/*自動換行*/

word-wrap: break-word;

word-break: normal;

/*強(qiáng)制英文單詞斷行*/

word-break:break-all;

2. 兩端對齊

text-align:justify;text-justify:inter-ideogra

3. 去掉Webkit(chrome)瀏覽器中input(文本框)或textarea的黃色焦點框

input,button,select,textarea{ outline:none;}

textarea{ font-size:13px; resize:none;}

注:去掉chrome記住密碼后自動填充表單的黃色背景

4. ie6: position:fixed

.fixed-top /* position fixed Top */{position:fixed;bottom:auto;top:0; }

* html .fixed-top /* IE6 position fixed Top */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}

*html{background-image:url(about:blank);background-attachment:fixed;}

5. clearfix

.clearfix:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0;}

.clearfix{display:inline-block;}

html[xmlns] .clearfix{display:block;}

* html .clearfix{height:1%;}


.clearfix{*zoom: 1;}

.clearfix:after{clear:both;display:table;content:"”;}


.clearfix{overflow:hidden;_zoom:1;}

6. min-height: 最小高度兼容代碼

.minheight500{

min-height:500px;

height:auto !important;

height:500px;

overflow:visible;

}

7. 鼠標(biāo)不允許點擊:

cursor:not-allowed;

8. mac font: osx平臺字體優(yōu)化

font-family:"Hiragino Sans GB","Hiragino Sans GB W3",'微軟雅黑';

9. 省略號:

.ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容