[英]Set position of div relative to position of another percentage-width div
[英]set minimum width of a div having position as relative
如何風格這個div都是具有最小寬度和寬度
CSS
#diva {
position: relative;
margin: 0 auto;
min-width: 75px;
width: auto;
height: 50px;
padding: 4px;
color: white;
background-color: red;
}
HTML
<div id="diva">
hello
</div>
當我將width設置為auto時 ,該div占據了整個頁面的寬度。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.