Select elements whose lang attribute's value starts with "en" - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:attribute contains word

Description

Select elements whose lang attribute's value starts with "en"

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
[lang|=en] {<!--from   www  .  j ava2  s.  c o  m-->
    background: yellow;
}
</style>
</head>
<body>

<p lang="en">Hello!</p>
<p lang="en-us">Hi!</p>
<p lang="en-gb">Ello!</p>
<p lang="us">Hi!</p>
<p lang="no">Hei!</p>

</body>
</html>

Related Tutorials