Title: Set image width a class.
Last modified: August 31, 2016

---

# Set image width a class.

 *  Resolved [Anthyx](https://wordpress.org/support/users/anthyx/)
 * (@anthyx)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/set-image-width-a-class/)
 * Hello,
 * I’m a CSS n00b, I REALLY need your help please, I’m going crazy:
 * I’m unable to set the width of an image using a class. That’s what I do:
 * In my style.css I set (for example) the class:
 * .pippo {width: 20px;};
 * In my html:
 * <img class=”pippo”; src=”[http://www.webfoodculture.com/wp-content/uploads/2015/06/antip_001_crocvic01.jpg&#8221](http://www.webfoodculture.com/wp-content/uploads/2015/06/antip_001_crocvic01.jpg&#8221);;/
   >
 * … result, just nothing! The image keeps the original size.
 * Many thanks in advance for your help!
 * A.

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

 *  [Asif Ullah](https://wordpress.org/support/users/asif5057/)
 * (@asif5057)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/set-image-width-a-class/#post-7454059)
 * Hi
 * Please share screenshot or website url.
 * Thanks
 *  Thread Starter [Anthyx](https://wordpress.org/support/users/anthyx/)
 * (@anthyx)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/set-image-width-a-class/#post-7454083)
 * Problem solved!
 * .pippo {
    display: inline-block; width: 20px; }
 * After many tries, I just put “display: inline-block”, and it works fine!
    Hope
   this helps someone else.
 * Many thanks! 😀
 * A.

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

The topic ‘Set image width a class.’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [Anthyx](https://wordpress.org/support/users/anthyx/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/set-image-width-a-class/#post-7454083)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
