- JavaScript by Example
- Dani Akash S
- 192字
- 2021-07-02 18:39:09
Responsive designing with flexbox
If you look into the index.html file of our previous chapter, you will see that there are classes, such as col-md-2, col-xs-2, col-lg-2, col-sm-2, and so on. They are Bootstrap's grid classes. The previous chapter's layout was designed using the Bootstrap grid system. The system divides the page into rows and 12 columns and allocates a specific number of columns to each div in a row depending on the screen size.
There are four different screen sizes:
- Desktop (md)
- Tablets (sm)
- Phones (xs)
- Large desktops (lg)
However, we are not going to use Bootstrap grids in this chapter. We are going to be using a new layout mode introduced in CSS3 called the flexbox. Flexbox or flexible box, as it sounds, provides a box model for creating layouts.
Flexbox is a new layout system, which is actively being implemented by the browser vendors. Support is almost complete; it's time to adopt this standard in projects. A few problems still exist, such as IE 11 only having partial flexbox support and older versions of IE do not support flexbox. Visit https://caniuse.com/ to check details on browser support for flexbox.
推薦閱讀
- 深入淺出Electron:原理、工程與實(shí)踐
- 微服務(wù)與事件驅(qū)動(dòng)架構(gòu)
- 編程卓越之道(卷3):軟件工程化
- Apache Spark 2.x Machine Learning Cookbook
- 用Python實(shí)現(xiàn)深度學(xué)習(xí)框架
- 深入RabbitMQ
- Cocos2d-x學(xué)習(xí)筆記:完全掌握Lua API與游戲項(xiàng)目開發(fā) (未來書庫)
- 精通Linux(第2版)
- Scala程序員面試算法寶典
- 從Java到Web程序設(shè)計(jì)教程
- 零基礎(chǔ)學(xué)C語言第2版
- Python計(jì)算機(jī)視覺和自然語言處理
- Learning Jakarta Struts 1.2: a concise and practical tutorial
- WordPress Search Engine Optimization(Second Edition)
- 深入淺出 HTTPS:從原理到實(shí)戰(zhàn)