Usage of CSS [attribute] Selector

CSSWeb DevelopmentFront End Technology

Use the [attribute] selector to select elements with an attribute, for example, an alt attribute or a target attribute, etc.

You can try to run the following code to implement the CSS[attribute] selector,


Live Demo

<!DOCTYPE html>
         img[alt] {
            border: 3px solid orange;
      <img src = ""
         height="200" width="200">
      <img src = ""
         height = "200" width="200" alt = "Tutorials Library">
Updated on 23-Jun-2020 15:03:03