Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Responsive image tinymce image link

I'm expanding an existing website. I have the site published (if you want to take a look click here). I have just added a very simple blog (made with php and mysql) and it works well, except for one thing. If I add an image to a new or post, the person that is writing the post is able resize it. The problem is that the image has static width and height, and then if I access the blog on a mobile device, the image is cut because it's bigger than the width of the device. I don't know how to solve it, I thaunght I could modify the plugin that allows to insert images to add this parameters (which makes an image responsive):

max-width="['user selected width'], width=100%, height=auto

I've been trying to modify the plugin but i find it very hard to understand, and i'm not very experienced on javascript. Here's the plugin. I'm using tinymce editor to edit or add posts. Anyone knows were I have to add this parameters? Thank you.

like image 410
joan2404 Avatar asked Dec 03 '25 09:12

joan2404


2 Answers

on tinymceini put this.... and voala

image_dimensions: false,
         image_class_list: [
            {title: 'Responsive', value: 'img-responsive'}
        ]
like image 57
SIGDL Avatar answered Dec 06 '25 00:12

SIGDL


add this class in file content.min.css

img {
    max-width: 100%;
    height: auto;
}
like image 27
softcod.com Avatar answered Dec 05 '25 22:12

softcod.com



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!