disabled button css code example

Example 1: not disabled css

:not([disabled])

Example 2: style disabled button

button:disabled,
button[disabled]{
  border: 1px solid #999999;
  background-color: #cccccc;
  color: #666666;
}

Example 3: css for disabled button

/* CSS Selectors for CSS2 and CSS3 both */
button:disabled,
button[disabled]{
  border: 1px solid #999999;
  background-color: #cccccc;
  color: #666666;
}

Example 4: css disabled

<input type="text" name="username" value="admin" >

<style type="text/css">
input[name=username] {
    pointer-events: none;
 }
</style>

Tags:

Html Example