Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use min-height in css

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces how to use min-height in css. It is very detailed and has a certain reference value. Friends who are interested must finish it!

The min-height property sets the minimum height of the element. This property value sets a minimum limit on the height of the element. Therefore, the element can be higher than the specified value, but not shorter than it. Negative values are not allowed to be specified.

Minheight instance

Set the minimum height of the paragraph:

P

{

Min-height:100px

}

Try it yourself.

Browser support

IE Firefox Chrome Safari Opera

All major browsers support the min-height attribute.

Note: no version of InternetExplorer (including IE8) supports the attribute value "inherit".

Default value: 0

Inheritance: no

Version: CSS2

JavaScript syntax: object.style.minHeight= "50px"

Possible values of min-height

Value description

Length defines the minimum height of the element. The default value is 0.

The% definition is based on the percentage minimum height of the block-level object that contains it.

Inherit states that the value of the min-height attribute should be inherited from the parent element.

TIY instance

Use pixel values to set the minimum height of an element

This example shows how to use pixel values to set the minimum height of an element.

Local interpretation of Cssmin-height application

We sometimes set an object box to avoid that the object cannot be propped up when there is no content, but the content is more or less uncertain, so the height cannot be fixed, so we need css to set the minimum height of the min-height to support the object box. When the content is small, the minimum height can display the content, and if the content surplus minimum height can hold, the object will also increase with the increase of content.

The above is all the contents of the article "how to use min-height in css". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report