In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article "how to use css to achieve grid layout" in addition to programmers most people do not quite understand, today Xiaobian in order to make you better understand "how to use css to achieve grid layout", summed up the following content, with a certain reference value, the detailed steps are clear, the details are handled properly, I hope you can get something through this article, let's take a look at the specific content.
The grid layout realized by css adapts to the change of width, the gap is exactly equal, and the width and height of each small grid are also equal.
The knowledge points involved in achieving such a page effect:
When laying out block elements inline, pay attention to the space between the two div.
The key for css to achieve the equality of width and height of div is to use the attribute padding-bottom. We set it to 100% to fully support the parent div.
There are many ways to center div vertically and horizontally. Here I use the absolute layout and then do the transformation to achieve it.
There are two kinds of box models for css3, one is the box model of IE: the width and height of the box includes borders, fills and margins, and the other is the W3C box model, which is opposite to the IE box model.
Html and css codes:
The width and height of css are equal. Menu-cells-wrap {border: 5px solid green;padding: 2pxscape width: 600pxscape: content-box;}. Menu-cell {width: 25% border-box;background display: inline-block;position: relative;box-sizing: border-box;background: white;}. Menu-cell > div {box-sizing: border-box;position: absolute;padding: 2pxash width: 100% height: 100% left: 0top: 0;}. Menu-cell:before {content: ""; display: inline-block Padding-bottom: 100% position width: .1px; vertical-align: middle;}. Content-wrap {position: relative;width: 100% position height: 100% box UV sizing: content-box;background: orange;}. Content-wrap:active {background: lightblue;}. Content {position: absolute;top: 50% left: 50% transform: translate (- 50%,-50%) } query room friends room information and admit defeat chat game rules login what is csscss is a computer language used to express the file style such as HTML or XML, mainly used to design the style of the web page to make the web page more beautiful. It is also a language that defines style structures such as fonts, colors, locations, etc., and css styles can be stored directly in HTML pages or separate style sheet files, while the priority of style rules is determined by css according to this hierarchical structure, so as to achieve cascading effect. Up to now, css can not only decorate the web page, but also cooperate with various scripts to format the web page.
Thank you for your reading, I hope you have a certain understanding of the key issue of "how to use css to achieve grid layout", the specific use of the need to do your own experiments to understand, quickly try it, if you want to read more related knowledge articles, 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.
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.