1
我有關於逗號分隔的CSS類的奇怪問題。火狐忽略了下面的類.Control-fakeSelect::after
: - See resultFirefox忽略CSS逗號分隔的類
.Control-field::-webkit-calendar-picker-indicator,
.Control-fakeSelect::after{
background-color: transparent; /* 1 */
background-image: url("data:image/svg+xml;utf8,%3Csvg%20width%3D%2215%22%20height%3D%229%22%20viewBox%3D%220%200%2015%209%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cg%20fill%3D%22%23444%22%3E%3Cpath%20d%3D%22M11.773.583L7.38%204.976%202.987.583C2.432.028%201.532.028.977.583c-.555.555-.555%201.455%200%202.01L6.374%207.99c.28.278.642.417%201.006.417.09%200%20.182-.01.27-.026.27-.05.526-.18.734-.39l5.4-5.397c.554-.555.554-1.455%200-2.01-.556-.555-1.456-.555-2.01%200z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E");
background-position: center right;
background-repeat: no-repeat;
color: transparent; /* 1 */
content: "";
cursor: pointer;
height: 15px;
line-height: 15px;
margin-top: 2px;
opacity: 1; /* 1 */
padding: 10px 0 10px 20px;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 15px;
}
但是,如果我從逗號分隔的列表中刪除.Control-field::-webkit-calendar-picker-indicator
這樣的CSS是這樣的:
.Control-fakeSelect::after{
background-color: transparent; /* 1 */
background-image: url("data:image/svg+xml;utf8,%3Csvg%20width%3D%2215%22%20height%3D%229%22%20viewBox%3D%220%200%2015%209%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Cg%20fill%3D%22%23444%22%3E%3Cpath%20d%3D%22M11.773.583L7.38%204.976%202.987.583C2.432.028%201.532.028.977.583c-.555.555-.555%201.455%200%202.01L6.374%207.99c.28.278.642.417%201.006.417.09%200%20.182-.01.27-.026.27-.05.526-.18.734-.39l5.4-5.397c.554-.555.554-1.455%200-2.01-.556-.555-1.456-.555-2.01%200z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E");
background-position: center right;
background-repeat: no-repeat;
color: transparent; /* 1 */
content: "";
cursor: pointer;
height: 15px;
line-height: 15px;
margin-top: 2px;
opacity: 1; /* 1 */
padding: 10px 0 10px 20px;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 15px;
}
火狐認識到CSS類。 See result。
之前有人遇到過這個問題,或者知道爲什麼Firefox忽略:: after添加到逗號分隔的css類之後?
感謝@ niels-keurentjes,我不知道那個瀏覽器忽略它,因爲它是供應商特定的。太糟糕了,但重複的CSS雖然:p – henrik123
幾年前,我發現了這種困難的方式,但它實際上是很好的行爲,當你潛入它:) –