What does css auto mean?

What does auto in css mean?

auto in css means auto-adaptation, while auto in css is often the default value, such as the height attribute of the element, the default value is auto, meaning highly adaptive.

Another example:

margin:0 auto

It means that the upper and lower margins are 0, and the left and right margins are auto, which means automatic adaptation.

However, if you want to use it, you must give the label the specified width, as follows:

<div class="center">Center</div>
<style type="text/css">
.center{
    width:200px;
    height:200px;
    margin:0 auto;
    background-color:yellow;
}
</style>

In addition, margin: 0 auto and margin: 0 auto 0 auto have the same effect. It means that the upper and lower margins are 0, and the left and right margins automatically adapt to the same width.

The above is what does css auto mean? For more details, please pay attention to other related articles on morioh.com!

#css #css-auto

What does css auto mean?
5.25 GEEK