html中auto是什么意思

html中auto是什么意思,第1张

html中auto是什么意思

html中,auto的意思是“自适应”,是很多样式属性的默认值;当没有给元素设置指定的样式属性时,属性默认值为“auto”,表示该元素的指定样式根据浏览器自适应。

本教程 *** 作环境: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是什么意思的详细内容,

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/699235.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-23
下一篇 2022-04-23

发表评论

登录后才能评论

评论列表(0条)

保存