Home  >  Article  >  Web Front-end  >  Styling each enabled element using CSS

Styling each enabled element using CSS

PHPz
PHPzforward
2023-09-16 22:13:021112browse

使用 CSS 设置每个启用元素的样式

To style each enabled element, use CSS's :enabled selector.

Example

You can try running the following code to style the enabled elements

Online demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         input:enabled {
            background: blue;
         }
      </style>
   </head>
   <body>
      <form action = "">
         Subject <input type = "text" name = "subject"><br>
         Student: <input type = "text" name = "student"><br>
         Age: <input type = "number" name = "age" disabled><br>
      </form>
   </body>
</html>

The above is the detailed content of Styling each enabled element using CSS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete