Title: wordpress caption injects css code
Last modified: August 19, 2016

---

# wordpress caption injects css code

 *  [dunkkan](https://wordpress.org/support/users/dunkkan/)
 * (@dunkkan)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/wordpress-caption-injects-css-code/)
 * Hi guys,
 * I’m dealing with the code that automatically is injected into the html always
   there’s a caption.
 * `<div class="wp-caption alignnone" style="width: 438px">`
 * I’d like to overwrite it, or avoid its appearence, but I don’t know how.
 * I tried :
 *     ```
       div .wp-caption{
       		width:500px;
       		}
       ```
   
 * But still nothing. Neither working only with the class .wp-caption…
    I can control
   the image is inside but not the caption itself, which eventually appears smaller
   than the image, so the text that follows gets wrapped too soon.
 * Did anyone solved that ?
 * Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [dunkkan](https://wordpress.org/support/users/dunkkan/)
 * (@dunkkan)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/wordpress-caption-injects-css-code/#post-1098245)
 * Ok, sorry.
 * the ‘p’ tag which defines the text is under control now (I had some extra padding).
 * If you need to make smaller the whole caption (because if your original images
   are huge the caption will break all), just use the max-width, _to the div_:
 *     ```
       div .wp-caption{
       		max-width:500px;
       		}
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘wordpress caption injects css code’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [dunkkan](https://wordpress.org/support/users/dunkkan/)
 * Last activity: [16 years, 11 months ago](https://wordpress.org/support/topic/wordpress-caption-injects-css-code/#post-1098245)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
