In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
今天小编给大家分享一下html中怎么写判断条件的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。
一、CSS3 @supports
1、常见用法
语法:
@supports (property: value){
element {
property: value;
}
}
"@supports"中的"条件规则"可以声明一条或者几个由不同的逻辑运算符相结合的声明(比如说,非(not),或(or),与(and)等),而且还可以使用括号来确定其操作的优先级关系。
比如:Flex布局
.flex {
float: left;
}
@supports (display: flex){
.flex {
display: flex;
float: none;
}
}
上面的代码可以用来应对那些不支持Flex布局的浏览器。
2、非(not)逻辑声明
@supports not (property: value){
element {
property: value;
}
}
当使用not时,表示浏览器不支持某些属性时,对应的样式将会渲染。
3、与(and)逻辑声明
@supports (property: value) and (property: value) {
element {
property: value;
}
}
当使用and时,只有and两端条件同时成立,也就是同时返回true时,对应的样式才会渲染。
4、或(or)逻辑声明
@supports (property: value) or (property: value) {
element {
property: value;
}
}
当使用or时,只要or两端任一条件成立,返回true,对应的样式就会渲染。
5、组合声明
@supports ((property: value) or (property: value)) and (property: value) {
element {
property: value;
}
}
注意:当使用or和and两个混合使用时,必须使用括号()来区分两者的优先级。如果只有一条表达式时,也必须使用括号()。
以上就是"html中怎么写判断条件"这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注行业资讯频道。
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.