# Setting width and height of an \<img\>

**URL:** <https://forum.kirupa.com/t/setting-width-and-height-of-an-img/296584>\
**Category:** Uncategorized\
**Created:** [September 17, 2009, 12:39am UTC](https://forum.kirupa.com/t/setting-width-and-height-of-an-img/296584 "2009-09-17T00:39:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [September 17, 2009, 12:39am UTC](https://forum.kirupa.com/t/setting-width-and-height-of-an-img/296584/1 "2009-09-17T00:39:57Z")

</div>

Without setting an image’s display property to “block”, the width and height properties don’t take effect.

```auto

img.someIcon {
   width: 10px;
   height: 15px;
}

```

How is it possible to set the width and height of an image through CSS while keeping the image displayed inline? I am aware that I can set it through HTML, but isn’t using CSS cleaner?
