5
<!DOCTYPE html>
<html>
<head>
<style>
#test iframe {
border: none;
background: #333;
width: 500px;
height: 500px;
overflow: hidden;
}
#test iframe:before {
display: block;
content: " test";
width: 500px;
height: 500px;
background: url('overlay.png') no-repeat;
position: relative;
top: 0px;
left: 0px;
z-index: 999;
}
</style>
</head>
<body>
<div id="test">
<p><iframe></iframe></p>
</div>
</body>
</html>
我想放置在iframe上的圖像,但由於某種原因:之前選擇器不與iframe相處 - 嘗試用其他iframe元素和它的作品使用:之前選擇器上的iframe
(請記住,在iframe需要是p標籤內)
「iframe」的內容是一個單獨的網頁;我不認爲你可以從父母申請CSS。如果可以,你可以在包含的頁面中使用'body :: before {/.....//}',也許? –
但即時通訊不試圖覆蓋iframe的內容 - 即時通訊嘗試覆蓋iframe對象本身,這就是爲什麼我不認爲它真的很重要 – Ryan
任何原因爲什麼你必須使用iframe:before和不只是它的父母段落? – Jayx