How to Automatically Determine Dimensions of Image in HTML Follow
I moved from another IDE to PhpStorm for my PHP/HTML/CSS development. There is a cool feature in that other IDE where you can drag an image from the file explorer into the code and it would generate the `<img>` tag with the appropriate width and height dimensions. Is there a way to do something similar in the PhpStorm IDE?
Please sign in to leave a comment.
phpStorm does have autocomplete if your path are correct.
NOTE: Ctrl + Space and the tab key are your friends!
For me I have a path of ./images/
Lists my images at that path. Just like code completion.
The control + space fills in the height and width attributes.
So while I know its not what your looking for, I thought I would point it out just incase you didn't know about it.
Once you get use to it, you can type them in faster than grabbing the mouse to drag and drop.
Another thing I did was change the Zen Coding template for img
SETTING > LIVE Templates > Zen HTML > img > Edit
Change it to
This will give you the height and width attribes when using img{Tab}
Brilliant, thanks. I did both the tab for a live template and the ctrl-space but didn't think that ctrl-space would ever work for width and height. Very cool.