Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 鼠标悬停时增加边界值_Css - Fatal编程技术网

Css 鼠标悬停时增加边界值

Css 鼠标悬停时增加边界值,css,Css,当鼠标悬停在这个css规则上时,我如何让我的寄宿生增大尺寸 .script_list > div:first-child, .script_list > div.ui-sortable-helper { border-width: 1px; -webkit-border-top-left-radius: 10px; -webkit-border-top-right-radius: 10px; -moz-border-radius-topleft: 10px; -m

当鼠标悬停在这个css规则上时,我如何让我的寄宿生增大尺寸

.script_list > div:first-child,
.script_list > div.ui-sortable-helper {
  border-width: 1px;
  -webkit-border-top-left-radius: 10px;
  -webkit-border-top-right-radius: 10px;
  -moz-border-radius-topleft: 10px;
  -moz-border-radius-topright: 10px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
 }

只需使用
:hover
后缀:

.script_list > div:first-child:hover,
.script_list > div.ui-sortable-helper:hover {
  border-width: 2px;
}
这是一个基本的问题

基本CSS非常简单,使用
:hover
状态。使用
框大小调整
属性确保框的整体大小(以及随后的布局)不会受到影响,如果这不是所需的效果

CSS

.frame {
    border: 1px solid black;
    height: 200px;
    width: 200px;

    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
            box-sizing: border-box;
}

.frame:hover {
    border-width: 10px;
}
HTML

<div class="frame"></div>


事实上,如果你想保持布局,框大小调整部分是至关重要的。事实上@Harsh,这是一个更好的表达方式。