www.webdeveloper.com
Results 1 to 2 of 2

Thread: How do I remove a default box shadow around required elements? (chrome in particular)

  1. #1
    Join Date
    Feb 2014
    Posts
    23

    How do I remove a default box shadow around required elements? (chrome in particular)

    I'm making a contact field for a website, and Im trying to get rid of the ugly default red box shadow that chrome automatically puts around required elements like my input forms for text.
    I have been using this method:

    Code:
    input:required, textarea:required {
        -moz-box-shadow:none;
        -webkit-box-shadow:none;
        -o-box-shadow:none;
        box-shadow:none;
    and this works for firefox, but chrome has a blue box shadow around the elements now. what am I doing wrong here? hmm

  2. #2
    Join Date
    Mar 2011
    Posts
    1,139
    The pseudo-class 'required' is not yet widely supported. You might try a pseudo selector instead. Something like:
    Code:
    input[required='required'], textarea[required='required']
    Otherwise, you'll just have to add a new, specific class to the tags.
    Rick Trethewey
    Rainbo Design

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles