-
-
Save liuyanghejerry/b034516365071ec21df6 to your computer and use it in GitHub Desktop.
Short sample to illustrate :lang() // source https://jsbin.com/yowaro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="zh"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.target:lang(zh) { | |
color: green; | |
} | |
.target:lang(zh-hk) { | |
/* color: blue; */ | |
all: unset; | |
} | |
.target:lang(en) { | |
color: red; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="target" lang="en">123123</div> | |
<div class="target" lang="zh-cn">中国字</div> | |
<div class="target" lang="zh-tw">繁體中國字</div> | |
<div class="target" lang="zh-hk">繁體中國字</div> | |
<script id="jsbin-source-css" type="text/css">.target:lang(zh) { | |
color: green; | |
} | |
.target:lang(zh-hk) { | |
/* color: blue; */ | |
all: unset; | |
} | |
.target:lang(en) { | |
color: red; | |
}</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.target:lang(zh) { | |
color: green; | |
} | |
.target:lang(zh-hk) { | |
/* color: blue; */ | |
all: unset; | |
} | |
.target:lang(en) { | |
color: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment