2017-09-18 124 views
0

這是我的iframe它包含大量表格。Src以iframe開頭

<iframe id="DlgFramed4906422-9070-4604-bd1b-91c4216b088a" class="ms-dlgFrame" src="/Lists/Interne%20nyheder/DispForm.aspx?ID=68&amp;IsDlg=1" frameborder="0" style="width: 592px; height: 542px;"></iframe>

我想使用iframe[src^="/Lists/Interne%20nyheder/DispForm.aspx"]但它似乎沒有我的網頁上工作。

如果我從我的css中刪除它,那麼下面的代碼工作得很好。

的CSS

iframe[src^="/Lists/Interne%20nyheder/DispForm.aspx"] { 

    #MSOZoneCell_WebPartWPQ1 { 
     .ms-formtoolbar { 
      display: none; 
     } 

     .ms-formtable { 
      /*width: 70%;*/ 
      tbody { 
       tr { 
        td.ms-formlabel { 
         display: none; 
        } 
       } 
      } 
     } 
    } 
} 
+0

這是CSS或更少/ SCSS?你不能像普通的CSS那樣嵌套類。它必須經過一個編譯器。 – OptimusCrime

+0

@OptimusCrime對不起,忘了添加它 –

+0

任何你不能只使用類或ID的理由? – OptimusCrime

回答

0

似乎有東西其他這是錯誤的,但它不是iFrame的選擇。我可以驗證用於iFrame的CSS選擇器確實在工作。您可以在下面最簡單的示例中看到這一點。

iframe { 
 
    border: 10px solid green !important; 
 
    display: block; 
 
    width: 200px; 
 
    height: 200px; 
 
} 
 
iframe[src^="/Lists/Interne%20nyheder/DispForm.aspx"] { 
 
    border: 10px solid blue !important; 
 
}
<iframe src="/Lists/Interne%20nyheder/DispForm.aspx"> 
 
</iframe>