`auto`值在CSS属性中的含义是什么。 [英] What is the meaning of `auto` value in a CSS property.

查看:100
本文介绍了`auto`值在CSS属性中的含义是什么。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CSS属性的 auto 值的含义是什么?当CSS属性的值设置为 auto

What is the meaning of auto value of a CSS property. What happens when value of a CSS property is set to auto?

推荐答案

根据元素的内容或上下文,自动调整

The value of said property is adjusted automatically according to the content or the context of the element.

例如,块级元素与 height:auto 将变得更高,因为它包含更多的文本。再例如,具有 margin:0 auto 的块元素将具有增加的左和右边距,直到它沿着视口的y轴居中。

For example, a block-level element with height: auto will grow taller as it contains more text. For another example, a block element with margin: 0 auto will have the left and right margins increased until it becomes centered along the y-axis of the viewport.

这取决于你赋值的属性,不同的属性根据内容和上下文的不同而有所不同。

It really depends on the property you give the value to, different properties behave differently depending on the content and context.

这篇关于`auto`值在CSS属性中的含义是什么。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆