Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have a max-width option for images while editing #3996

Closed
julientechdev opened this issue Oct 12, 2017 · 3 comments
Closed

Have a max-width option for images while editing #3996

julientechdev opened this issue Oct 12, 2017 · 3 comments

Comments

@julientechdev
Copy link

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
When importing an image by pasting the url, the image size isn't adjusted to the editor size inside the iframe, and if the image is bigger it's not fully displayed.
After saving the image, the width is adjusted to the parent element, this is not very WYSIWYG.

What is the expected behavior?
Having an option to have the image resized to the editor width while editing (eg. 'auto') or to manually set the max width by setting it (eg. '300px'),

Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE?
4.7.1 / Firefox 57 / Linux

@fyrkant
Copy link

fyrkant commented Oct 19, 2017

You can set the content_style setting to something like content_style: 'img {max-width: 100%;}' and the images should resize to fit the editor.

@julientechdev
Copy link
Author

thanks, it worked

@jjb
Copy link

jjb commented Sep 23, 2022

This was very helpful, thanks! Most folks will probably also want height:auto

content_style: 'img { max-width: 100%; height: auto; }' 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants