Title: CSS class for password-protected form
Last modified: August 19, 2016

---

# CSS class for password-protected form

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/css-class-for-password-protected-form/)
 * Can a class be added to the form that is displayed when a post is password protected,
   please? As it currently stands, it’s impossible to selectively style any of the
   elements in the form.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Anonymous User
 * (@anonymized-3085)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/css-class-for-password-protected-form/#post-1624065)
 * I think this will work, not adding a class to the form itself, just wrapping 
   it in a quick div for styling.
 *     ```
       add_filter('the_password_form','my_password_form');
       function my_password_form($text){
       $text='<div class="myform">'.$text.'</div>';
       return $text;
       }
       ```
   
 * untested.
 *  Thread Starter [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/css-class-for-password-protected-form/#post-1624078)
 * Yes – that does help. But, ideally, the class should be on the form itself. All
   of the other front-end forms have either an id or a class – why not this one?
   Seems to be a much neglected corner of WP…
 *  Anonymous User
 * (@anonymized-3085)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/css-class-for-password-protected-form/#post-1624261)
 * raise a trac ticket?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘CSS class for password-protected form’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 3 replies
 * 2 participants
 * Last reply from: Anonymous User
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/css-class-for-password-protected-form/#post-1624261)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
