第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

是否可以使用重復(fù)線性漸變屬性設(shè)置邊框圖像和背景?

是否可以使用重復(fù)線性漸變屬性設(shè)置邊框圖像和背景?

元芳怎么了 2023-08-21 16:52:10
我正在嘗試使用該選項來設(shè)置border-image和屬性,但對同一元素使用不同的值。我不知道該怎么做,因為通過我的嘗試,漸變參數(shù)似乎重疊,并且頁面似乎采用了最后設(shè)置的值。backgroundrepeating-linear-gradient<div>這是我得到的代碼和輸出:body {    margin: 0;    background:    linear-gradient(217deg, rgba(255,0,0, .8), rgba(255,0,0,0) 70.71%),    linear-gradient(127deg, rgba(0,255,0, .8), rgba(0,255,0,0) 70.71%),    linear-gradient(336deg, rgba(0,0,255, .8), rgba(0,0,255,0) 70.71%);}.under_banner {    width: 100%;    height: 20%;    top: 80%;    border-width: 10px 0 0 0;    border-style: solid;    border-image: repeating-linear-gradient(145deg, #ff0000, #ff9020 50%);    background: repeating-linear-gradient(130deg, #f6d808, #ffc107 10%);    text-align: center;    line-height: 10px;    position: fixed;    z-index: 1;}<body>  <div class="under_banner">    <p>Hello StackOverflow Community!</p>  </div></body>正如你所看到的,.under_banner具有top-border屬性,實際上repeating-linear-gradient與 1 并不對稱background。如果可能的話,我想用一個 div 為每個屬性獲得不同的漸變。
查看完整描述

1 回答

?
鴻蒙傳說

TA貢獻1865條經(jīng)驗 獲得超7個贊

您可以使用多個背景:

body {

? ? background:

? ? linear-gradient(217deg, rgba(255,0,0, .8), rgba(255,0,0,0) 70.71%),

? ? linear-gradient(127deg, rgba(0,255,0, .8), rgba(0,255,0,0) 70.71%),

? ? linear-gradient(336deg, rgba(0,0,255, .8), rgba(0,0,255,0) 70.71%);

}


.under_banner {

? ? width: 100%;

? ? left:0;

? ? height: 20%;

? ? bottom:0;

? ? background:?

? ? ? repeating-linear-gradient(130deg, #f6d808, #ffc107 10%) bottom/100% calc(100% - 10px),

? ? ? repeating-linear-gradient(145deg, #ff0000, #ff9020 50%);

? ? background-repeat:no-repeat;

? ? text-align: center;

? ? line-height: 10px;

? ? position: fixed;

? ? z-index: 1;

}

<body>

? <div class="under_banner">

? ? <p>Hello StackOverflow Community!</p>

? </div>

</body>

或者像下面這樣調(diào)整你的代碼,你只是缺少切片屬性:


body {

? ? background:

? ? linear-gradient(217deg, rgba(255,0,0, .8), rgba(255,0,0,0) 70.71%),

? ? linear-gradient(127deg, rgba(0,255,0, .8), rgba(0,255,0,0) 70.71%),

? ? linear-gradient(336deg, rgba(0,0,255, .8), rgba(0,0,255,0) 70.71%);

}


.under_banner {

? ? width: 100%;

? ? left:0;

? ? height: 20%;

? ? bottom:0;

? ? border-width: 10px 0 0 0;

? ? border-style: solid;

? ? border-image: repeating-linear-gradient(145deg, #ff0000, #ff9020 50%) 10; /* added the slice here */

? ? background: repeating-linear-gradient(130deg, #f6d808, #ffc107 10%);

? ? text-align: center;

? ? line-height: 10px;

? ? position: fixed;

? ? z-index: 1;

}

<body>

? <div class="under_banner">

? ? <p>Hello StackOverflow Community!</p>

? </div>

</body>

查看完整回答
反對 回復(fù) 2023-08-21
  • 1 回答
  • 0 關(guān)注
  • 122 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號