我有一個contenteditable div,並將另一個絕對定位元素(小方塊)放在它上面。contenteditable保證金適用於其他絕對定位元素
奇怪的是:在Chrome中,padding-right
屬性不斷應用於小方塊,即使它不在CSS中。此外,填充不適用於contenteditable。
這是Chrome錯誤?我opretty知道我在做正確的事:
<div contenteditable=true>hello</div>
<div id=closer></div>
和
div[contenteditable] {
border:1px solid #900;
width:200px;
overflow:hidden;
white-space:nowrap;
padding-right:20px; /* <- the wascawwy wabbit */
}
#closer {
position:absolute;
border:1px solid #090;
width:20px;
height:20px;
top:0px;
left:180px;
}
body {padding:0;margin:0;}
這是一個q&a網站而非c&p網站 – Horen 2013-04-04 20:47:57
LOL。真正的+1 ... – tim 2013-04-04 23:03:02
希望你認識到,當你鍵入你的答案時,至少還有一個人在做同樣的事情。停止行事愚蠢,你的答案不是那麼輝煌,有人複製它:) – Stefan 2013-04-05 07:50:23