Width and Height attributes in HTML area


#1

Enonic version: 6.15.6
OS: Ubuntu

We are trying to use the iframe tag in an HTML area field with width and height attributes:

<iframe width="100%" height="100px"  src="https://www.w3schools.com"><p>Your browser does not upport iframes.</p></iframe>

However, for some reason, Enonic is discarding width and height attributes.

We have tested that in 6.14.3 version and it is working fine.


#2

It’s the HTML editor that strips out inline attributes. In general, you should use CSS to apply styling to HTML elements. If you absolutely have to use width/height as inline attributes in this case you can create a macro for the iframe element.


#3

I see. Thanks! :slight_smile:


#4

This topic was automatically closed after 4 hours. New replies are no longer allowed.