How to apply CSS to an iframe?

Spread the love

Sometimes, we want to apply CSS to an iframe.

In this article, we’ll look at how to apply CSS to an iframe.

How to apply CSS to an iframe?

To apply CSS to an iframe, we can use the style attribute.

For instance, we write

<iframe
  name="iframe1"
  id="iframe1"
  src="empty.htm"
  frameborder="0"
  border="0"
  cellspacing="0"
  style="border-style: none; width: 100%; height: 120px"
></iframe>

to add the style attribute to the iframe to style the iframe.

Conclusion

To apply CSS to an iframe, we can use the style attribute.

Leave a Reply

Your email address will not be published. Required fields are marked *