locked
CKEditor Image Style Issue RRS feed

  • Question

  • User1601878731 posted

    For CKEditor,nuget package ckeditor-standard and logical uploader for ckeditor installed.

    I am using ckeditor for textarea to have more features like text editing and image insertion.

    and that data is fetched in one string variable.

    I am inserting 2-3 images with simultaneous content like a blog.

    While displaying data,if image having more width/more height of image.

    that image shows beyond page,how to set again height and width of images after i got html as a string.

    After fetching data,it is decoding through

    ViewBag.data = System.Net.WebUtility.HtmlDecode(editor1);

    I am displaying data through @Html.Raw(data) method.

    Now the image shows beyond page,how to set again height and width of images after i got html as a string?

    How to fix it,can anyone tell me?

    Thanks in Advance.

    Tuesday, June 7, 2016 7:45 AM

Answers

  • User1601878731 posted

    I resolved this issue by below CSS:

    p img {
    width: 100%;
    max-width: 500px;
    max-height:500px; 
    }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 14, 2016 12:58 PM