html - How to point to an id under 1 frame css -


this question has answer here:

i have following code snippet:

...     <iframe id="srcashoverviewdashboard" class="srcashoverviewdashboard" width="100%" height="1000px" frameborder="0" name="srcashoverviewdashboard" scrolling="no" rdiframeadditionalscrollheightadded="" rdiframeadditionalscrollwidthadded="" onload=" iframeresize(this)" rdiframefixedwidth="true" data-hiddensource="rdpage.aspx?rdreport=dashboard.cashlevel1&rdrequestcache=3707323034&rdsubreport=true&rdresizeframe=true" src="rdpage.aspx?rdreport=dashboard.cashlevel1&rdrequestcache=3707323034&rdsubreport=true&rdresizeframe=true" style="overflow: hidden; width: 100%; height: 1000px;">   <!doctype html>   <html id="yui_3_1_1454057078100_124" class="yui3-js-enabled" xmlns:rdxslextension="urn:rdxslextension" xmlns:msxsl="urn:schemas-microsoft-com:xslt" style="margin: 0px; width: 100%; height: 100%; cursor: auto;">    <head>     <body id="yui_3_1_1454057078100_106" onload="rdbodyload()" style="margin: 0px; width: 100%; height: 100%;">       <div style="display: none; background-image: url('rdtemplate/rdwaitall.gif')"></div>       <div id="yui_3_1_1454057078100_1056" class="yui3-widget rdquicktip yui3-widget-positioned rdquicktip-hidden" style="left: 0px; top: 0px;">       <div style="display: none; background-image: url('rdtemplate/rdwaitall.gif')"></div>       <div style="display: none; background-image: url('rdtemplate/rdwaitall.gif')"></div>       <div id="yui_3_1_1454057078100_345" class="yui3-widget rdquicktip yui3-widget-positioned rdquicktip-hidden" style="left: 0px; top: 0px;">       <div style="display: none; background-image: url('rdtemplate/rdwaitall.gif')"></div>       <div id="yui_3_1_1454057078100_237" class="yui3-dd-shim" style="top: 0px; left: 0px; position: absolute; z-index: 9999; overflow: hidden; background-color: red; display: none; height: 5px; width: 5px;"></div>       <div style="display: none; background-image: url('rdtemplate/rdwaitall.gif')"></div>       <div id="yui_3_1_1454057078100_56" class="yui3-widget rdquicktip yui3-widget-positioned rdquicktip-hidden" style="left: 0px; top: 0px;">       <div style="display: none; background-image: url('rdtemplate/rdwaitall.gif')"></div>       <form id="yui_3_1_1454057078100_107" method="post" name="rdform">         <input id="rdcsrfkey1" type="hidden" value="cb35ed6b-fbd0-4f81-947f-db1b4e3a8531" name="rdcsrfkey">         <div id="rdmainbodystart"></div>         <div id="rdmainbody">         ...             </div> 

i want add style rdmainbody. there more specific #rdmainbody id's on webpage want add style one.

everything id's , classes auto generated, except iframe, contains id srcashoverviewdashboardand class srcashoverviewdashboard.

so trying add in css file .srcashoverviewdashboard #rdmainbody or #srcashoverviewdashboard #rdmainbody

but doesn't seem work, do wrong or need else?

greetings

you can use jquery's .content() function access it.

$('youriframe').contents().find('#youritemyouwanttochange').css({     opacity: 0,     color: 'purple' }); 

see fiddle , this post.


Comments