使边框绕过整个窗口会导致显示垂直滚动条?

时间:2018-12-28 02:40:47

标签: css border

通过搜索,我发现以下代码应该在整个浏览器窗口周围形成边框。

几乎...

即使/** * Removes the element at the specified position in this list. * Shifts any subsequent elements to the left (subtracts one from their * indices). * * @param index the index of the element to be removed * @return the element that was removed from the list * @throws IndexOutOfBoundsException {@inheritDoc} */ public E remove(int index) { rangeCheck(index); modCount++; E oldValue = elementData(index); int numMoved = size - index - 1; if (numMoved > 0) System.arraycopy(elementData, index+1, elementData, index, numMoved); elementData[--size] = null; // clear to let GC do its work return oldValue; } 中的内容为零,垂直滚动条也会显示:

<body>

我急需一支救援队。

1 个答案:

答案 0 :(得分:1)

您只需要将box-sizing: border-box;添加到您的body CSS中。

html {
    height: 100%;
}

body {
    min-height: 100%;    
    margin: 0px;    
    border: solid darkgreen;
    box-sizing: border-box; // add this line
}

MDN中了解有关box-sizing的更多信息