html中auto是什么意思-LMLPHP

本教程操作环境:windows10系统、CSS3&&HTML5版、Dell G3电脑。

html中auto是什么意思

auto表示的是自动适应。

是很多css样式属性的默认值。

例如:

margin:0 auto
登录后复制

意思就是上下边距为0,左右边距为auto,就是自动适应。

如果在CSS中没有给属性设置值,那么浏览器客户端将会取该属性的初始值进行渲染,也就是根据浏览器自适应。

示例如下:

<div class="center">居中</div>
<style type="text/css">
.center{
    width:200px;
    height:200px;
    margin:0 auto;
    background-color:yellow;
}
</style>
登录后复制

推荐教程:《html视频教程

以上就是html中auto是什么意思的详细内容,更多请关注Work网其它相关文章!

09-09 02:26