Perhaps you should use this:
<div class="image"> <img src="image.gif" /> </div>
CSS
div.image img{ width: 100% }
The problem with putting style inside html is that everything becomes messy. You should try to separate html from css and js as much as possible.
Also, from my point of view, it is not a good practice to use php in css or js files.
Consider viewing your html layout to optimize it.
source share