2017-06-09 28 views
0

不知道爲什麼當視口的寬度至少爲1000px時,我在第一個矩形的底部獲得了線性漸變。更寬的屏幕上的柔性盒中的線性漸變

enter image description here

fiddle

梯度:

.hero:before { 
    content: ""; 
    position: absolute; 
    top: 0px; 
    right: 0; 
    bottom: 5px; 
    left: 0; 
    border-radius: 10px; 
    background: linear-gradient(rgba(0,0,0,0) 65%, rgb(93, 240, 255) 120%); 
} 
+3

你是什麼意思的'移位線性漸變'?這看起來在所有尺寸 – DanCouper

+0

[這裏是](http://i.imgur.com/ocMVQjD.png)完全一樣,我也提到過,可能是因爲這個原因,額外的空間是從右邊加入 – cygnus

+0

讓我知道這項工作:'.hero:first-child {flex-basis:calc(66.6% - 10px); }' – LGSon

回答

0

無關,與線性梯度或類似的東西,頂部的兩個元素的寬度是不同的底三的寬度(520 + 255 = 775vs255 + 255 + 255 = 765)。然後你使用calc%值,所以實際(像素)差異根據屏幕大小而變化