tags:

views:

62

answers:

2

Hi,

I have used an with external src. Can i overwrite the table background color of that external page. How to overwrite table background color comimg through tag?

Please help me!!!!

A: 

css declarations in the HTML page override those that are declared in external .css files. So, if you add something like this in the part of html:

<style type="text/css">
   //some css here
 </style>

the duplicate values will be overriding declarations from your css file.

skazhy
Will these CSS styles effect things inside an iframe though? I wouldn't have thought so myself but I'll admit to not having tested it.
Chris
A: 

First I want to ask you that why you use iframe? instead you can use jQuery ajax which overlays your iframe code. Because Now a days people don't use iframe as it has lots of limitation.

by using ajax load, you can access child page JavaScript and vise-versa.

following code may help you then,

<html>
<body>
<table id="x" bgcolor="red">
    <tr><td>Vikas</td></tr>
</table>
<script>
    change("blue");
    function change(color)
    {
        document.getElementById("x").setAttribute("bgcolor", color);
    }
</script>
</body>
</html>
Vikas