Selects all elements with alt attribute with CSS

To select elements with an attribute, use the CSS [attribute] selector.

For example, 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">