Jump to:

5512 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » How can I stop Tinymce insert height and width attributes to my images?

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 715 Views
  • mrsteveheyes
    Avatar
    Community Member
    15 Posts

    How can I stop Tinymce insert height and width attributes to my images? Link to this post

    Hi there,

    Currently, when I add image through the TinyMCE image insert function it adds a height and width attribute to the <img> tag. I want to stop that, as it a responsive site and so need the image to be flexible.

    Is this possible? Has anyone done it before or know how?

    Thanks in advance,
    Steve

  • kinglozzer
    Avatar
    Community Member
    138 Posts

    Re: How can I stop Tinymce insert height and width attributes to my images? Link to this post

    Hi Steve,

    I've not found any way of preventing that, but I've overcome it before using CSS. Usually, giving img a max-width: 100%; and height: auto; will solve it - browsers seem to ignore the width/height attributes when 'height: auto' is applied.

    Hope this helps,
    Loz

    715 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.