CSS Attribute Selectors is possible to style HTML elements that have specific attributes or attribute values.

Example :

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Document</title>
    <style>
        a[target] {
            background-color: yellow;
            color: red;
        }
    </style>
</head>
<body>
    <p>The links with a target attribute gets a yellow background.</p>
    <a href="https://www.educationidol.in/" target>Education Idol Website</a> &nbsp;&nbsp;&nbsp;
    <a href="https://globalinstitute.co.in/" target="">Global Computers</a>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="https://akashelectrical.co.in/">Akash Electrical</a>
</body>
</html>

Show Output :

CSS 07 Attri Sel Image 1

Leave a Comment