我真的不敢相信我已经坐下来解决这个问题 2 个多小时了,为什么我来这里乞求一些答案。为什么不验证此代码?它与在互联网上找到的代码完全相同,而且我似乎是唯一收到此验证消息的人。
我收到的消息:
Egenskap -webkit-min-device-pixel-ratio finns inte för medium screen ) { p.hej { > color: blue; } } 25 Egenskap -ms-high-contrast finns inte för medium all ), (-ms-high-> contrast: none) { p.hej { color: green; } }
还有两个警告
can't find the warning message for vendor-ext-pseudo-class
32 can't find the warning message for vendor-ext-pseudo-class ##
我不明白为什么。
我正在尝试做的是一个简单的 HTML 文件,它通过 CSS 使用这些变量单独调整:
火狐:-moz- Chrome och Safari:-webkit- Internet Explorer:-ms- 歌剧:-o-
HTML:
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Min fantastiska uppgift 2.8</title>
<link href="sajt3.css" rel="stylesheet" type="text/css">
</head>
<body>
<p class="hej">Hej!!!</p>
</body>
</html>
CSS:
/*
Firefox targeting, red h1 text color
*/
body:not(:-moz-handler-blocked) p.hej {
color:red;
}
/*
Chrome & Safari targeting, blue h1 text color
*/
@media screen and (-webkit-min-device-pixel-ratio:0) {
p.hej { color: blue; }
}
/*
IE targeting, green H1 text color
*/
@media all and (-ms-high-contrast: active), (-ms-high-contrast: none) {
p.hej { color: green; }
}
/*
Opera targeting; purple bg
*/
x:-o-prefocus, p {
background: purple;
}
最佳答案
如果您将 css 的第一位更改为
body:not(.hej) {
color:red;
font-weight:bold;
}
.hej{color:blue;}
这是一个fiddle
我不认为它喜欢将 id 和类名放在一起!
关于html - 中屏幕不存在属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31819988/