xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

CSS 弹性盒子模型

CSS 弹性盒子模型

https://www.w3.org/TR/2016/CR-css-flexbox-1-20160526/

CSS Flexible Box Layout Module Level 1

W3C Candidate Recommendation, 26 May 2016

1

1

深入了解 Flexbox 伸缩盒模型

1

w3schools

 

http://www.w3schools.com/html/tryit.asp?filename=tryhtml_layout_semantic

http://www.w3schools.com/css/css3_flexbox.asp

 

http://www.w3cplus.com/

1

1

 

Website Layout Using HTML5

HTML5 offers new semantic elements that define different parts of a web page:

HTML5 Semantic Elements
  • <header> - Defines a header for a document or a section
  • <nav> - Defines a container for navigation links
  • <section> - Defines a section in a document
  • <article> - Defines an independent self-contained article
  • <aside> - Defines content aside from the content (like a sidebar)
  • <footer> - Defines a footer for a document or a section
  • <details> - Defines additional details
  • <summary> - Defines a heading for the <details> element

This example uses <header>, <nav>, <section>, and <footer> to create a multiple column layout:

 

HTML Layout Using <div> Elements

Note The <div> element is often used as a layout tool, because it can easily be positioned with CSS.

This example uses four <div> elements to create a multiple column layout:

HTML Layout Using Tables

Note The <table> element was not designed to be a layout tool.
The purpose of the <table> element is to display tabular data.

Layout can be achieved using the <table> element, because table elements can be styled with CSS:

 

 

 http://www.w3schools.com/html/html_responsive.asp

1

1

4 Different HTML/CSS Layout Techniques to Create a Site

 

 

  • Tables. What’s good about them? Using tables for layout creation is intuitive. You can see them almost everywhere! You don’t even need to use a separate CSS stylesheet when using tables. And, what is more important, they don’t break. Have you ever seen a broken table? No? Me neither. Sounds great. We’ll use one of them for our site later.
  • Float. We’re talking about the CSS property here. It’s common practice to use float within your web page to create a layout. And, in this case, you will need to use a separate stylesheet. Two files, huh? Sounds not so convenient comparing to using tables. However, using float is kind of a standard. The only way you’ll use your HTML file is to determine the content of your web page. If you want to align your content in some freaky way, you must use the CSS file. Only!
  • CSS Frameworks. These work the same way as JavaScript frameworks. Just add the source file to your header (using<link rel="stylesheet" type="text/css" href="stylesheets/framework_file.css">, for example) and it’s ready to go! There is no need to write your own properties. Just use the classes that framework developers prepared for you. Sounds great. But how does it work? We’ll see.
  • Flexbox. Flexbox is a short name for the CSS Flexible Box Layout Module. And this is something new comparing to the float property, for example. The main idea behind the flexbox is to give a container the ability to alter its items’ width, height and order. You should use it if you want to fill the available space in the best possible way. For example, to accommodate to all kind of display devices and screen sizes. A flex container will expand its items to fill the screen.

 


https://www.w3.org/TR/2016/CR-css-flexbox-1-20160526/

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @   xgqfrms  阅读(118)  评论(7编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示