爲什麼顛倒background
屬性的下層元素border-radius
設置在更高的元素上?背景顛倒border-radius
我有這樣的HTML代碼:
<div class="wrapper">
<div class="content">
<div class="header">Title</div>
<div class="form"></div>
</div>
</div>
而這個CSS代碼:
.wrapper {
background: none repeat scroll 0 0 #F8F8F8;
border-radius: 5px 5px 5px 5px;
height: 250px;
left: 100px;
overflow: visible;
position: absolute;
top: 10%;
width: 400px;
z-index: 10000
.header {
background: none repeat scroll 0 0 #222222;
border-top-left-radius: 5px;
box-shadow: 0 0 5px #444444;
position: relative;
z-index: 1;
}
}
結果是沒有border-radius
在頂部,只是在底部。如果我刪除.header
類的background
屬性,border-radius
可以在所有四個方面工作。這裏有什麼問題?
你現在的代碼顯示邊框半徑.. –
第一)有一個問題,大括號在CSS中。 – Farkhad