html如何自动调整边框大小,html – Chrome与大小调整:显示中的边框:表格
我正在使用display:table做一個(gè)小的2窗格布局.對(duì)于間距(也來(lái)自背景圖像),我使用填充.因?yàn)槲倚枰⒆觽冇幸粋€(gè)確切的寬度:50%來(lái)自可用空間(考慮到父div的填充),我使用Box-sizing:border-Box.
這在Opera中運(yùn)行良好,但在Chrome中,框大小:border-Box或甚至-webkit-Box-sizing:border-Box會(huì)被忽略.
我做了一個(gè)演示,顯示了這個(gè)問(wèn)題.兩個(gè)紅色框應(yīng)為方形,藍(lán)色框的寬度和高度應(yīng)為200px:http://jsfiddle.net/fabb/JKECK/
這是html源代碼:
Something on the left side
Something on the right side
和CSS:
#table {
display: table;
/*border-collapse: collapse;*/
width: 200px !important;
height: 200px !important;
Box-sizing: border-Box;
-webkit-Box-sizing:border-Box;
-moz-Box-sizing:border-Box;
margin: 0;
border: 1px solid blue;
padding: 60px 20px;
}
#table #left,#table #right {
display: table-cell;
width: 50%;
Box-sizing: border-Box;
-webkit-Box-sizing:border-Box;
-moz-Box-sizing:border-Box;
margin: 0;
border: 1px solid red;
padding: 0;
}
這是Chrome中的錯(cuò)誤嗎?或者我做錯(cuò)了什么?
總結(jié)
以上是生活随笔為你收集整理的html如何自动调整边框大小,html – Chrome与大小调整:显示中的边框:表格的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: android 把异常写入到文本里,尝试
- 下一篇: html选择文本框后提示消失,两种方法实