<style> BODY.other-frame{ background:red; } BODY.other-frame DIV{ border:3px solid green; } </style> <script> otherFrame.document.body.className = "other-frame"; </script>