w3resource

HTML CSS Exercise: Select elements by attribute

Solution:

HTML Code:

<!doctype html>
<html>
<head>
<title>HTML CSS Exercise - Select elements by attribute</title>
<style>
.container[data-name=w3r]{
color:#5ac4ed;
}
</style>
</head>
<body>
<div class="container" data-name="w3r">Web developemnt tutorials.</div>
<div class="container">HTML, CSS, JS, PHP...</div>
</body>
</html>

Live Demo:

See the Pen select-elements-by-attribute-answer by w3resource (@w3resource) on CodePen.


Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
YesYesYesYesYes

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.