0
A
回答
2
您可以使用Flex和梯度backg圓形:http://codepen.io/gc-nomade/pen/XNgamB
* {
margin:0;
padding:0;
}
ul {
display:inline-flex;
flex-flow:column;
vertical-align:top;
width:13em;
height:17em;
background:#153454;
box-shadow:inset 0 0 2px ;
border:8px solid #224262;
background:linear-gradient(97deg, transparent 3em , #153454 1em),
linear-gradient(to top, #00B169 20%, #00A6C4 20% , #00A6C4 40%, #FFDE00 40%, #FFDE00 60%, #FF9900 60%, #FF9900 80%, #E40000 80%)
}
li {
flex:1;
text-align:center;
display:flex;
align-items:center;
justify-content:center;
font-variant:small-caps;
color:#ddd;
font-size:1.5em;
}
.act, li:hover {
box-shadow:inset 0 0 0 2px #FF9600
}
<ul>
<li>item</li>
<li>item</li>
<li class="act">item</li>
<li>item</li>
<li>item</li>
</ul>
+0
我已經與之後,但這看起來適合我。謝謝 – noitse
0
.example {
width:200px;
height:40px;
color: white;
line-height:40px;
text-align: center;
background-color: #333;
}
.example::before {
content: '';
display:block;
float: left;
width: 10px;
border-right: 10px solid transparent;
border-top: 40px solid red;
}
<div class="example">text<div>
0
.example {
width:200px;
height:40px;
color: white;
line-height:40px;
text-align: center;
}
.example:nth-child(1) {
background: linear-gradient(105deg, red 20px, #000 20px);
}
.example:nth-child(2) {
background: linear-gradient(105deg, yellow 10px, #000 10px);
}
<div class="example">text</div>
<div class="example">text</div>
這裏的另一個解決方案
+0
但使用線性漸變將使它鋸齒 –
0
好與周圍擺弄後:我已成功後,使其看起來好,還是要發揮一點與數字使其更加完善的
https://jsfiddle.net/noitse/peyvxto4/
HTML:
<div class="levels">
<div class="certain">CERTAIN</div>
<div class="expected">EXPECTED</div>
<div class="probable">EXPECTED</div>
<div class="possible">EXPECTED</div>
<div class="notexpected">NOT EXPECTED</div>
</div>
CSS:
levels{
width:12em;
border:2px solid #06182a;
height:16em;
margin-left:7%;
border-radius:4px;
background-color:#153454;
padding:5px;
}
.levels div{
color:white;
height:20%;
text-align:center;
vertical-align: center;
position:relative;
}
.levels div.certain:after{
content:'';
height:100%;
width:20%;
border-top: 3.2em solid red;
position:absolute;
border-right:7px solid transparent;
left:0px;
}
.levels div.expected:after{
content:'';
height:100%;
width:16%;
border-top: 3.2em solid orange;
position:absolute;
border-right:7px solid transparent;
left:0px;
}
.levels div.probable:after{
content:'';
height:100%;
width:12.5%;
border-top: 3.2em solid yellow;
position:absolute;
border-right:7px solid transparent;
left:0px;
}
.levels div.possible:after{
content:'';
height:100%;
width:10%;
border-top: 3.2em solid blue;
position:absolute;
border-right:7px solid transparent;
left:0px;
}
.levels div.notexpected:after{
content:'';
height:100%;
width:6%;
border-top: 3.2em solid green;
position:absolute;
border-right:7px solid transparent;
left:0px;
}
1
這是一個使用我的版本clip-path
(JSFiddle)
.red {color: #e10215; }
.orange {color: #fca326; }
.yellow {color: #fdda2e; }
.blue {color: #22a6c2; }
.green {color: #1fbf73; }
.menu {
list-style: none;
max-width: 200px;
border: 1px solid #081829;
outline: 8px solid #254361;
padding: 0;
}
.menu-item {
position: relative;
text-transform: uppercase;
font-family: sans-serif;
font-weight: 300;
background-color: #183553;
padding: 1em 2em;
box-sizing: border-box;
}
.menu-item span {
display: block;
}
.menu-item .deco {
width: 20%;
position: absolute;
height: 100%;
top: 0;
left: 0;
}
.menu-item .label {
width: 100%;
padding-left: 20%;
color: white;
}
.menu-item:hover {
outline: 1px solid;
outline-offset: -1px;
}
.red .deco {
background-color: #e10215;
-webkit-clip-path: polygon(0 0, 90% 0, 80% 100%, 0% 100%);
clip-path: polygon(0 0, 90% 0, 80% 100%, 0% 100%);
}
.orange .deco {
background-color: #fca326;
-webkit-clip-path: polygon(0 0, 80% 0, 70% 100%, 0% 100%);
clip-path: polygon(0 0, 80% 0, 70% 100%, 0% 100%);
}
.yellow .deco {
background-color: #fdda2e;
-webkit-clip-path: polygon(0 0, 70% 0, 60% 100%, 0% 100%);
clip-path: polygon(0 0, 70% 0, 60% 100%, 0% 100%);
}
.blue .deco {
background-color: #22a6c2;
-webkit-clip-path: polygon(0 0, 60% 0, 50% 100%, 0% 100%);
clip-path: polygon(0 0, 60% 0, 50% 100%, 0% 100%);
}
.green .deco {
background-color: #1fbf73;
-webkit-clip-path: polygon(0 0, 50% 0, 40% 100%, 0% 100%);
clip-path: polygon(0 0, 50% 0, 40% 100%, 0% 100%);
}
<ul class="menu">
<li class="red menu-item">
<span class="deco"></span>
<span class="label">Certain</span>
</li>
<li class="orange menu-item">
<span class="deco"></span>
<span class="label">Expected</span>
</li>
<li class="yellow menu-item">
<span class="deco"></span>
<span class="label">Probable</span>
</li>
<li class="blue menu-item">
<span class="deco"></span>
<span class="label">Possible</span>
</li>
<li class="green menu-item">
<span class="deco"></span>
<span class="label">Not expected</span>
</li>
</ul>
相關問題
- 1. CSS背景顏色
- 2. CSS背景三角3種顏色
- 3. 用角度改變背景顏色
- 4. CSS:背景顏色的背景圖像
- 5. CSS不透明度和背景顏色
- 6. CSS鏈接背景顏色寬度
- 7. CSS背景改變顏色 - 梯度
- 8. CSS不透明度 - 背景顏色
- 9. div的CSS背景顏色
- 10. HTML/CSS的背景顏色
- 11. 圓角與背景顏色
- 12. 整頁背景顏色角
- 13. 配置顏色/背景顏色CSS
- 14. 忽略CSS背景顏色
- 15. CSS導航背景顏色
- 16. CSS,phpBB和背景顏色
- 17. 重置背景顏色CSS
- 18. CSS:背景顏色問題
- 19. CSS背景顏色問題
- 20. CSS背景顏色挑剔
- 21. CSS,背景顏色/圖片
- 22. CSS光標背景顏色?
- 23. css背景顏色問題
- 24. CSS背景顏色問題
- 25. 結合背景顏色和梯度一個背景CSS屬性
- 26. 背景或背景顏色?
- 27. CSS - 背景前景對比度文本顏色
- 28. 背景顏色
- 29. 背景顏色
- 30. 背景顏色
我已經試過這http://stackoverflow.com/questions/12699210/background-平角與一邊角 但不能得到角度匹配,目前嘗試前/後 – noitse