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

Styling each enabled element using CSS

PHPz
Release: 2023-09-16 22:13:02
forward
1120 people have browsed it

使用 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>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template