Gideon So Posted April 21, 2018 Share Posted April 21, 2018 Hi, Anyone knows if it is possible to prevent the ckeditor add width to the image and how can I add class / width="100%" to an image?? Please, I know I can do this with a piece of JS but I don't want to do it with JS. Gideon Link to comment Share on other sites More sharing options...
theo Posted April 21, 2018 Share Posted April 21, 2018 Afaik CSS has precedence over HTML width. So either define width:100% for all your images or insert a special class for this (e.g. "img_responsive"). .img_responsive { width: 100%; } To make it selectable from the CKE toolbar, do sth. like CKEDITOR.stylesSet.add('mystyles', [ { name: 'Fullwidth', element: 'img', attributes: { 'class': 'img_responsive' } } ]); 2 Link to comment Share on other sites More sharing options...
Gideon So Posted April 21, 2018 Author Share Posted April 21, 2018 Hi @theo Thanks. I think it works but still want to know whether we can have the image plugin back along with PwImage and make life easier. Gideon Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now