css 頁面特殊顯示效果,css頁面效果

來源:互聯網
上載者:User

css 頁面特殊顯示效果,css頁面效果

1.移動端最小設定字型為12px,如果想要更小字型效果:

-webkit-transform:scale(0.9);

 

2.文字超過兩行時,末尾顯示點點的效果:

overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;

 

3.文字不換行,長度超過60px時顯示點點的效果:

width: 60px;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
-webkit-text-overflow:ellipsis;

 

4背景圖片的相容性寫法:

background: url("../img/header_bg.png") no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 100%;
height: 55px;

 

5.線性漸層條的相容性寫法:

background: -moz-linear-gradient(bottom, #F66E22, #FFD260);
background: -webkit-linear-gradient(bottom, #F66E22, #FFD260);
background: -o-linear-gradient(bottom, #F66E22, #FFD260);

 

6.多使用flex布局(一般處理上下左右置中)

display: flex;
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
當然還有其他一些常見的,比如:
flex: 1;(自適應長度)
-webkit-flex: 1;
flex-direction: culumn;(對齊)
-webkit-flex-direction: column;
flex-wrap: wrap;(啟用換行,預設不換行)
-webkit-flex-wrap:wrap;

不再贅述,詳細請參考:http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html?utm_source=tuicool

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.