Jump to content

Not able to add class or width="100%" to image which is inserted in CKeditor


Gideon So
 Share

Recommended Posts

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' } }
]); 

 

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...