Skip to content

Instantly share code, notes, and snippets.

@liuyanghejerry

liuyanghejerry/index.html

Forked from anonymous/index.html
Last active Jan 21, 2016
Embed
What would you like to do?
Short sample to illustrate :lang() // source https://jsbin.com/yowaro
<!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>
.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
You can’t perform that action at this time.