Using CSS to affect div style inside iframe

前端 未结 13 1564
失恋的感觉
失恋的感觉 2020-11-22 07:00

Is it possible to change styles of a div that resides inside an iframe on the page using CSS only?

相关标签:
13条回答
  • 2020-11-22 07:26

    A sort of hack-ish way of doing things is like Eugene said. I ended up following his code and linking to my custom Css for the page. The problem for me was that, With a twitter timeline you have to do some sidestepping of twitter to override their code a smidgen. Now we have a rolling timeline with our css to it, I.E. Larger font, proper line height and making the scrollbar hidden for heights larger than their limits.

    var c = document.createElement('link');
    setTimeout(frames[0].document.body.appendChild(c),500); // Mileage varies by connection. Bump 500 a bit higher if necessary
    
    0 讨论(0)
提交回复
热议问题