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
几年前,我发现了这种困难的方式,但它实际上是很好的行为,当你潜入它:) –