SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    May 2006
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS and text fields

    Does anyone know how using CSS I can make a text field change color when a user hovers over it?

  2. #2
    SitePoint Wizard bronze trophy Tailslide's Avatar
    Join Date
    Feb 2006
    Location
    Bedford, UK
    Posts
    1,687
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    input:hover, textarea:hover {background:#ccc;}
    You'll need a bit of scripting help to force IE6 and under to work properly - there are several ways but I usually just add the whatever hover script.

    Code:
    <!--[if lt IE 7]>
    <style type="text/css">
    body {behavior: url(scripts/csshover.htc);}
    </style>
    <![endif]-->
    Little Blue Plane Web Design
    Blood, Sweat & Rust - A Land Rover restoration project


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
  •