CSS outline 与 border 的区别
html公开前 25 行,完整代码需登录
<html>
<head>
<meta charset="utf-8">
<title>outline 与 border 的区别</title>
<style>
.comparison {
width: 200px;
height: 100px;
background-color: #f0f0f0;
margin: 20px;
padding: 15px;
display: inline-block;
vertical-align: top;
}
/* border 占用空间 */
.with-border {
border: 5px solid blue;
}
/* outline 不占用空间 */
.with-outline {
outline: 5px solid red;
}