css 常用樣式

2021-10-08 18:30:34 字數 1761 閱讀 8051

設定透明背景

opacity:0.2; 或 background-color:rgba(220,38,38,0.2);

// 相關樣式

background-color: #000000;

// linear-gradient函式用於建立乙個線性漸變的 "影象" 90deg(角度值)

background: linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);

// background-size屬性指定背景大小。

background-size: 400%;

// filter 屬性定義了元素(通常是

filter: blur(20px);

/** view內文字過多省略顯示 單**況*/

overflow:hidden;//超出一行文字自動隱藏

text-overflow:ellipsis;//文字隱藏後新增省略號

white-space:nowrap;//強制不換行

/** 多**況*/

display: -webkit-box;

word-break:break-all;

text-overflow:ellipsis;

font-size:28rpx;

overflow:hidden;

-webkit-box-orient: vertical;

-webkit-line-clamp:2;//設定 需要顯示的行數

// 不使用專案符號(去除li符號)

list-style: none;

// overflow 屬性規定當內容溢位元素框時發生的事情。

// auto 如果內容被修剪,則瀏覽器會顯示滾動條以便檢視其餘的內容。

overflow: auto;

//屬性定義在滾動容器中的乙個臨時點如何被嚴格的執行。

//簡單而言,這個屬性規定了乙個容器是否對內部滾動動作進行捕捉,並且規定了如何處理滾動結束狀態。

//scroll-snap-type:none | [ x | y | block | inline | both | ] [ mandatory | proximity ] ?

//與scroll-snap-align: start;配合使用

ulli

// 隱藏滾動條

-ms-overflow-style: none; /* ie 10+ 隱藏滾動條*/

scrollbar-width: none; /* firefox 隱藏滾動條*/

/* 谷歌瀏覽器隱藏滾動條 .roller指的是div的類名*/

.roller::-webkit-scrollbar

background-image: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, 

rgba(0,0,0,0) 25%, rgba(0,0,0,0) 75%, rgba(0,0,0,0.3) 100%);

// 設定陰影效果

box-shadow: inset 0px 0px 12px rgba(0,0,0,0.2);

// 讓盒子裡面的內容垂直居中的方法

div

css 常用樣式

css 說的通俗一點就是 給標籤加樣式的。什麼玩意是樣式呢。你們可以理解為人穿的衣服,化妝之類的修飾,讓自己的寫的標籤變的好看一點 那麼這個css 怎麼加到對應的標籤上面去呢 有3種方法 分別是 外部樣式 內頁樣式 行內樣式。那麼這個css 怎麼加到對應的標籤上面去呢 有3種方法 分別是 外部樣式 ...

css常用樣式

格式調整 標籤的位置調整 text align center 絕對元素生成 position absolute margin right 微調上下左右 浮動 float 上下左右 width 寬 height 高 樣式調整 字型粗細 font weight size 字型格式 text decora...

CSS常用樣式

img box imgparentelement childelementfilter alpha opacity 60 filter progid dximagetransform.microsoft.gradient startcolorstr red,endcolorstr blue,grad...