我有一个宽度和高度为100px的div。同一div在不同的页面中显示不同的大小。
.#{$prefix}-ui-buffering-overlay-indicator {
$theme-color: var(--themeColor);
border: 14px solid rgba(white, .2);
border-radius: 50%;
border-top: 14px solid $theme-color;
border-left: 14px solid $theme-color;
display: inline-block;
width: 100px;
height: 100px;
-webkit-animation: spin 2s linear infinite;
/* Safari */
animation: spin 2s linear infinite;
}
答案 0 :(得分:-1)
您尝试添加box-sizing: border-box
吗?
.ex1 {
padding: 100px;
width: 100px;
height: 100px;
background: red;
}
.ex2 {
padding: 100px;
width: 100px;
height: 100px;
background: blue;
box-sizing: border-box;
}
<div class="ex1" />
<div class="ex2" />