Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Problem changing scrollbar design in iframe

I am using iframe on my site. Now I want to make the scroll on the right side of the iframe invisible. I’ve searched the whole internet but all the codes I’ve found don’t work.

This is my iframe

<iframe src="../pages.php" width="100%" height="650px" class="gitartik"></iframe>

last piece of code I tried

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

.gitartik{
    overflow-y: scroll;
}

.gitartik::-webkit-scrollbar {
    width: 0px;
}

``

>Solution :

CSS of the parent frame cannot affect an iframe, you have to include it in the source of the page loaded by the iframe.

JavaScript of the parent page can add CSS to the page in the iframe, if both pages come from the same origin (which seems to be the case in your example).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading