SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: buttons and CSS

  1. #1
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    buttons and CSS

    is there a way to modify button states with CSS? Like the down state or the disabled state?

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    In mozilla you can modify the hover and active states, but I#m assuming you knew that anyway.

    You could also use the attribute selector to target a disabled button like this:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    input[disabled] {
    background-color: blue;
    font-weight: bold;
    color: #ffffcc;
    }
    </style>
    </head>
    <body>
    <form method="post" action="">
      <input class="button" type="submit" value="Submit" disabled="disabled" />
    </form>
    </body>
    </html>
    Again its only mozilla/opera that will see it.

    Paul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •