Quantcast
Channel: CakePHP image not resizing, fitting container - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by floriank for CakePHP image not resizing, fitting container

$
0
0

In most modern programming languages it is possible to add an image to your page and then resize it to fit a container using max-height attributes in either the surrounding div or the image tag. In cakephp this is not the case.

First HTML is not a programming at all but a markup language. See Is HTML considered a programming language?

php itself is very well capable of resizing and cropping images. CakePHP doesn't feature any abstraction for that because it's out of the scope of the framework. There are enough third party libs that will do the job already. If you want to manipulate images using CakePHP try the Imagine plugin.

At the end of the day what you try to do has nothing to do at all with php or CakePHP. I've corrected your tags for that reason.

With the right search terms you would have found plenty of solutions already, here is one of them: CSS scale down image to fit in containing div, without specifing original size


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>