[attribute]
In this chapter you will learn:
Description
The [attribute]
selector selects elements with the specified attribute.
Example
<!DOCTYPE html><!--from ja v a 2s .co m-->
<html>
<head>
<style>
a[target]
{
background-color:red;
}
</style>
</head>
<body>
<a href="http://java2s.com" target="_black">java2s.com</a>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
- Definition for Selector [attribute=value]
- An example showing how to use [attribute=value] CSS selector
Home » HTML CSS Tutorial » CSS Selector Reference