html - 中屏幕不存在属性

标签 html css properties size

我真的不敢相信我已经坐下来解决这个问题 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/

相关文章:

c# - 如何返回集合的只读副本

javascript - 如何更改knockout.js中数组的值?

javascript - 如何将一个div放置在另一个div中?

php - 单击图像时如何在php变量中获取img标签的id?

javascript - 引用具有多个变量的 HTML ID

jquery - 如何在单击按钮时从选定列表框中删除多个选定值

css - 我如何处理 Internet Explorer 缺乏功能?

html - 标题 div 不在内容 div 之上

Java 数组属性越界异常

android - 在 android 布局编辑器中,当我单击任何 View 时,属性 View 不会更新