w3resource

HTML CSS Exercise: Target attribute begins with a certain value

Solution:

HTML Code:

<!doctype html>
<html>
<head>
<title>HTML CSS Exercise - Target attribute begins with a certain value</title>
<style>
.container[data-name^=w3r]{
color:#5ac4ed;
}
</style>
</head>
<body>
<div class="container" data-name="w3resource">Web developemnt tutorials.</div>
<div class="container" data-name="w3r">HTML, CSS, JS, PHP...</div>
</body>
</html>

Live Demo:

See the Pen target-attribute-begins-wth-a-certain-value-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.