css樣式總結

來源:互聯網
上載者:User

標籤:縮排   pre   lips   indent   元素   ica   設定   position   ide   

  1. 文本較多時,只顯示n行多餘的用…代替(以下代碼直接在less中封裝好的) @num---想要顯示的行數

.font-hide(@num){
  word-break:break-all;
  text-overflow: ellipsis;
  display:-webkit-box; /** 將對象作為伸縮盒子模型顯示 **/
  -webkit-box-orient: vertical; /** 設定或檢索伸縮盒對象的子項目的相片順序 **/
  -webkit-line-clamp: @num; /**顯示的行數 **/
  overflow:hidden;  /**隱藏超出的內容 **/
}

 2.   固定一個樣式

position:fixed;
z-index:3;
left:0;
right:0;
bottom:0;

 3.  兩欄自適應

#left-1 {

    float: left;

    background-color: red;

}

#right-1 {

    overflow: hidden;

    background-color: blue;

}

4.    首行縮排

text-indent:25px

5.    背景固定

background:url(‘../images/bg.jpg‘);
background-repeat:no-repeat;
background-size:100% ;
background-attachment: fixed;//固定不動

6.   取消input預設樣式

-webkit-appearance: none;

css樣式總結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.