In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor will share with you the relevant knowledge points about how to set the adaptive height of DIV height and DIV. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.
1. Set the height height style within the div tag
The height style of this DIV box can be set by using the style attribute within the div tag.
Small example:
My height is 50px.
Explanation: the above sets the height height style through the style attribute style of the div tag.
External style settings specify the height of the div box
This method is a commonly used external label CSS styling object styling method. You can use it by writing the CSS code into the CSS file and then introducing it into the CSS file through HTML, or you can use the style tag to set the CSS styling code directly within the HTML source code.
Here is a demonstration of using style tags to set external CSS styles within the source code of html pages.
To observe the effect of this div height height instance, the object div is named ".", the width is 150px, the height is 80px, the CSS border is 1px blue.
DIV+CSS small example CSS code:
. {height:80px; width:150px; border:1px solid # 00F}
Small example HTML code:
My height is 80px.
Screenshot of css+div height small example effect:
Third, how to set the adaptive height of div
How to achieve the adaptive height of div, which increases with the increase of div content and decreases with the decrease of div content?
It is very simple to height:auto, of course, the style value of the default height of div is auto. If you want to adapt the height of div, you can achieve it without setting the height style for div.
Expand related readings:
1. Div width
2. Css width
3. Css picture width
4. Css adaptive height
5. Span width setting
6. Css hides div content beyond width
7. The text shall not exceed the fixed width
8. Div width calculation
9. The picture breaks the div solution
10. Css height
11. Minimum height and maximum height of css
These are all the contents of the article "how to set the adaptive height of DIV height and DIV". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.