我想在div的右側有一個關閉按鈕,但比div高一點。像以下圖片:把關閉按鈕放在父div的右側
尋找一點點後,我發現了以下相關的問題here,我試圖修改它一點點地得到我想要的東西。
我嘗試可以viewed on the fiddle:
<div class="area">
<span class="close">X</span>
<div class="areaInside">some data</div>
</div>
.areaInside{
border: 2px dashed #bbb;
border-radius: 10px;
color: #bbb;
min-height: 80px;
}
.area{
width:70%;
height:100px;
}
.close{
float:right;
cursor: pointer;
font-weight: bold;
}
但顯然它不會做什麼我想要的。我希望關閉按鈕位於該區域之上並稍微靠左。如何在不更改標記的情況下實現這一點(僅限於css)。