CSS Layout

CSS进阶篇——布局 (Layout) 现代 CSS 让页面布局变得非常简单,当年只能 HTML tables 和切图的时代已经一去不复返。 阅读详情

This tutorial teaches the css fundamentals that were collected by these sites as follows and maybe keep on updating in the future.

And I may not told you what is a box model such questions. You should know the reason.

learnlayout
ruanyifeng

Position

  • let us get started with the static.

    The static value which belongs to the position attribute is the default value.

    And we will told you that what is the positioned mean, now you just need remember it.


  • The next position attribute we will study is the relative value.

    And relative behaves the same as static unless you add some extra properties.

    Setting the top, right, bottom, and left properties of a relatively-positioned element will cause it to be adjusted away from its normal position.
    Other content will not be adjusted to fit into any gap left by the element.


  • Let us have a break, and give you a new conception: normal flow , which confused me that was translated document flow(文档流) in Chinese.

    Do not consider it as a complex conception, just as it`s denotation which means that the section was displayed from left to right,up to down.

    It`s a traditional HTML layout.

    There are three properties will escape from normal flow, we will talk about it next, float, fixed, ans absolute.

    There is another conception text flow, but we will not talk about it today.

    If you want to know more about it, just have a google.


  • Well, let us press on.

    We will go ahead with the fixed property, and you just need to remember three points.

    • Firstly, a fixed element does not leave a gap in the page where it would normally have been located.

    • Secondly, a fixed element does not leave a gap in the page where it would normally have been located.

    • Thirdly (Ok … three points), a fixed element is positioned relative to the viewport, which means it always stays in the same place even if the page is scrolled.


  • “Hold on, you guys will get the endpoint soon !”

    • The last station is absolute property. And you just remember one thing. Year, really one.

    • Absolute behaves like fixed except relative to the nearest positioned ancestor instead of relative to the viewport.


Float

  • We mention it on the above content just now.

  • Simple introduction:

    Float is intended for wrapping text around images.

  • Year, the above is true, but we should get to know more about it.

  • And you should know this attribute clear which was related to float attribute closely.

  • I can not describe it very well, so I suggested you have a look on this link: The clear attribute

  • And I am very glad to receive your answer about this attribute if you guys wanna to provide this post.

  • You may got a boring question when you use the float: when the img is larger than the div block, the img will get overflow, here a method seems weird but useful.

     .clearfix {
      overflow: auto;
    }
  • Then the basic tasks were done. I will show you a float layout example to make you understand it. float example


Self-Basic-Attribute

  • The interesting thing is the width and height.

  • To avoid repetition, I just come up with the width to make tutorial.

  • percent width I think it is a very useful attribute.

  • Because you did not need to fix the attributes of children when you change the parent width as you used percent width not specific data.

  • media queries. It is a good method to resolve the Responsive Design layout.

  • Responsive Design is the strategy of making a site that responds to the browser and device that it is being shown on… by looking awesome no matter what.

  • Max-width, as it means. It can control the max-width, so you will not get the boring when the browser make the change behavior.

  • box-sizing, we know that box border will have a change size on eyes when it has the attribute as border, margin, padding. But the box-sizing will fix it.


Display

  • Every element has a default display value depending on what type of element it is.

  • The default for most elements is usually block or inline.

  • A block element is often called a block-level element.

  • An inline element is always just called an inline element.

block element

◎ address
◎ blockquote
◎ center
◎ dir
◎ div
◎ dl
◎ fieldset。。。
◎ form
◎ h1 and h[2-6]
◎ hr 
◎ isindex
◎ menu 
◎ noframes 
◎ noscript 
◎ ol 
◎ p 
◎ pre 
◎ table 
◎ ul

inline element

◎ a 
◎ acronym 
◎ b 
◎ bdo  
◎ big  
◎ br  
◎ cite  
◎ code 
◎ dfn  
◎ em  
◎ font 
◎ i  
◎ img  
◎ input  
◎ kbd 
◎ label 
◎ q  
◎ s  
◎ samp 
◎ select  
◎ small  
◎ span  
◎ strike  
◎ strong  
◎ sub  
◎ sup  
◎ textarea 
◎ tt  
◎ u  
◎ var  

variable element
The variable element is depend on 
the context display block on inline.

◎ applet - java applet
◎ button - button
◎ del - delete text
◎ iframe - inline frame
◎ ins - insert text
◎ map - graphic area
◎ object - object
◎ script - client script
  • There are plenty of more exotic display values, such as list-item and table. Here is an exhaustive list.

Flex(mvp)

As you can see, the css was so difficult to control use, so I recommend you guys these frameworks link to make your work easier.

But there is a particular character we will take it as today mvp, here are two tutorials were post by ruanyifeng.

flex samples

flex introduction

  • Show you an old but useful info image.
    old but useful

  • Two points here need to be remembered firstly.

    • Every container could has flex, but if inline, try inline-flex.

    • If you set the flex on the element, the children will lose the float、clear and vertical-align properties.


  • Tips: Flex container has main axis and cross axis. Both of them have the start and end point.

  • Six container properties.
flex-direction
decide the main axis.(The item orientation)
flex-direction: row | row-reverse | column | column-reverse;

flex-wrap
decide how to get a newline
flex-wrap: nowrap | wrap | wrap-reverse;

flex-flow
just flex-direction and flex-wrap shortening
flex-flow: <flex-direction> || <flex-wrap>;

justify-content
decide the items alignment on the main axis

align-items
decide the items alignment on the cross axis
align-items: flex-start | flex-end | center | baseline | stretch;

align-content
decide the axis alignment 
align-content: flex-start | flex-end | center | space-between | space-around | stretch;
  • Six items property
order
decide the items orientation order.
The smaller the value, the more forward the arrangement.
order: <integer>; /* default 0 */


flex-grow
decide scale of growth, zero means will not enlarge even there are space.
flex-grow: <number>; /* default 0 */

flex-shrink
decide scale of shrink, one means will shrink while not get enough space.
flex-shrink: <number>; /* default 1 */

flex-basis
define the main size before the extra space was distributed.
flex-basis: <length> | auto; /* default auto */

flex
shortening for the follow properties
flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]

align-self
It allows the item has an special property not like brothers. 
Auto means inherit from parents, but mean like stretch if no parents.
align-self: (default)auto | flex-start | flex-end | center | baseline | stretch;
  • As you can see, I do not explain these properties clearly, so you really should have a look on the two links:

flex samples

flex introduction


Those are all tonight learning, good luck everyone.

CSS table-layout 属性 table-layout属性为表设置表格布局算法。默认值:auto继承:no版本:CSS2object。 阅读详情

相关推荐

布局CSS文件layout.css

布局CSS文件layout.css 提供与布局有关的CSS定义 文件下载

CSS学习—layout

文章目录盒模型盒模型—边框 盒模型 css将页面中的所有元素都设为一个矩形的盒子,将元素设为盒子后,对元素的布局就变为将不同的盒子摆放到不同的地方。每一个盒子由以下几个部分组成: 内容区(content) 内边距(padding) 边框(border) 外边距(margin) <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>盒模型<

Lum1n0us's Blog 1105

The New Css Layout

The New Css Layout CSS 布局

我的前端学习笔记03-Layout

文档流(normal flow) 网页是一个多层的结构,一层摞着一层 通过CSS可以分别为每一层来设置样式 作为用户来讲只能看到最顶上一层 这些层中,最底下的一层称为文档流,文档流是网页的基础 我们所创建的元素默认都是在文档流中进行排列 对于我们来元素主要有两个状态 在文档流中 不在文档流中(脱离文档流) 元素在文档流中有什么特点: 块元素 块元素会在页面中独占一行...

weixin_44698814的博客 529

ROS实践(四)机器人SLAM建图(gmapping)

本文介绍了SLAM技术及其实现方法。SLAM(同步定位与地图构建)让机器人在未知环境中通过传感器数据自主定位并构建地图。文章详细讲解了激光雷达、RGBD相机等常用传感器,以及gmapping和map_server这两个ROS功能包的使用方法。重点阐述了SLAM建图实验步骤:配置gmapping节点参数、启动机器人仿真、运行gmapping节点、使用rviz可视化工具、通过键盘遥控机器人完成地图构建并保存。实验结果表明,该方法能有效实现机器人自主建图功能,为后续导航等应用奠定基础。

qq_1033275663的博客 4344

在Ubuntu上通过Wine完美运行企业微信的详细指南

本文提供了在Ubuntu系统上通过Wine兼容层安装和运行企业微信的详细教程。针对官方未提供Linux版本的痛点,指南推荐使用Ubuntu Kylin团队优化打包的Wine环境,通过简单的命令行步骤即可完成部署,并涵盖启动、中文输入法配置、文件管理等常见问题的解决方案,帮助用户实现高效、稳定的办公沟通。

weixin_29306317的博客 233

CSS基础笔记-05layout

本文研究了CSS layout的normal flow,flex,grip和float。

渔道的博客 1360

【论文笔记】Reaching agreement in the presence of faults (EIG)

1 问题定义 2 交互一致性 3 单点故障 m=1 n=4 4 多点故障(n&amp;gt;=3m+1) 计算过程 m=2 n=7 5 n&amp;lt;3m+1不能达成协定 6 带认证的算法 7 总结 这篇论文在1980年发表,是1982年著名的拜占庭将军问题论文的前身。作者Leslie Lamport是2013图灵奖得主,两篇论文引用次数分别为5000+和2000+。该论文提出的算法现在被...

zjwreal 2995

bootstrap layout.css,布局 | Layout

布局 | Layout布局您的 Bootstrap 项目的组件和选项,包括包装容器、强大的网格系统、灵活的媒体对象和响应性实用工具类。Containers容器是 Bootstrap 中最基本的布局元素,在使用我们的默认网格系统时是必需的。选择响应式固定宽度的容器(意味着它max-width在每个断点处的变化)或流体宽度(意味着它100%始终是宽的)。虽然容器可以嵌套,但大多数布局不需要嵌套容器。...

weixin_39816027的博客 611

BEVFusion实战:从零搭建LiDAR-Camera融合的3D目标检测环境(附避坑指南)

本文提供了BEVFusion实战指南,详细讲解如何从零搭建LiDAR-Camera融合的3D目标检测环境。内容涵盖环境配置、数据预处理、模型训练与性能优化等关键步骤,并附有实用的避坑技巧,帮助开发者高效部署这一先进的BEV感知算法。

p4q5r6s7t的博客 516

【DRAM存储器七】SDRAM介绍-芯片引脚与功能框图详解

详解初代SDRAM芯片引脚定义与芯片功能框图中的各个模块

highman110的博客 2211

CSS 的新技术CSS Layout API

CSS Layout API是Houdini的一部分,后者是一组CSS扩展,旨在赋予开发者直接操作CSS内部工作方式的能力,包括动画、布局和样式计算等。通过CSS Layout API,开发者可以直接与CSS引擎交互,创建自定义的盒模型和布局算法,从而打破传统的网页设计界限。

读心悦 772

资产会计 Transaction Type 与业务交易的 Post to Affiliated Company 不一致导致的 AAPO176:成因剖析与修复指引

本文解析了SAP资产会计中常见的"AAPO176"错误提示,指出当交易类型(TType)与业务交易(Business Transaction)的"关联公司过账"(Post to Affiliated Company)标志不一致时,系统会拒绝过账。作者详细说明了该标志的作用机制,并提供了四种解决方案:修正交易类型使用、匹配正确的业务交易、调整系统配置或建立映射关系。文章还通过实际案例展示了配置错误对集团合并报表的影响,并附带了用于检查配置一致性的ABAP脚本。该错误通常

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 404

css2 table-layout学习

参考文档 CSS table-layout 属性 表格中的table-layout属性讲解 问题来源 在做移动app的时候想用表格显示内容,每列的宽度非常的有限,因此想用单行省略的效果来显示内容,我发现无论我怎么调整样式,界面都是全部显示每行的内容,查询了一些成功的案例,知道要给table添加table-layout样式 案例 &lt;!DOCTYPE html&gt; &lt;html la...

黄彪博客 457

电磁场仿真软件:Sonnet_(1).Sonnet软件概述

根据特定需求自定义仿真流程,如多频率点仿真、多边界条件仿真等。

kkchenjj的博客 1454

电机瞬态分析基础(2):理想电机的基本假设和正方向规定

电机瞬态分析基础之理想电机假设条件和正方向规定

weixin_45670943的博客 1146

CSS中table-layout属性的作用及使用详解

 以前看过不少css的用法,但对于一些不叫少用的属性没有怎么看过,今天在经典上看贴,发现了一个对“怎么用CSS强制TD不换行?”话题的讨论,发现了table-layout这个属性的使用详解,先贴出来内容:table-layout  版本:CSS2  兼容性:IE5+ 继承性:无语法:table-layout : auto | fixed 取值:auto : 默认值。默认的自动算法。布局将基于

johncools的博客 9144

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

无涯教程-CSS - Layout(网页布局)

易于设计。无涯教程可以使用CSS布局来设计网页,例如主页,与关于我们,联系我们等。CSS布局可以包含页眉,页脚,左窗格,右窗格和正文部分。一起看一个CSS布局的简单示例。

无涯教程 1147

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

html css 布局layout

【代码】html css 布局layout。

weixin_46328739的博客 1114

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

三. CSS layout(布局)

1.文档流(normal flow) 网页是一个多层的结构,一层摞着一层,通过CSS可以分别为每一层来设置样式,作为用户来讲只能看到最顶上一层,这些层中,最底下的一层称为文档流,文档流是网页的基础, 我们所创建的元素默认都是在文档流中进行排列, 对于我们来元素主要有两个状态: 在文档流中 不在文档流中(脱离文档流) 元素在文档流中有什么特点: 块元素 块元素会在页面中独占一行(自上向下垂直排列) 默认宽度是父元素的全部(会把父元素撑满) 默认高度是被内容撑开(子元素) 行内元素 行内元素不会独

scyllake的博客 1325

微信小程序css篇----布局(Layout)

说到布局,脑子里第一反应出来的就是LinearLayout,RelativeLayout等等,不过现在既然是小程序,那当然得换换思路了,来看看css中有哪些布局方式。 一:布局有以下几种:display,float,clear,visibility,overflow,overflow-x,overflow-y。 1.display:设置对象是否显示。 2.float:指出对象是否及如何浮动。

鎏嫣宫守护的博客 4万+

layout.css

@charset "utf-8"; /* -------------------------------------------------  * layout css   * copyright: http://www.tianya.cn/   http://www.w3cplus.com/  * author: marvin   * email: xuyc_brother[at]foxmail

daditao的专栏 1315

css div layout,Layout.css

Layout.csscube 中并没有提供大而全的栅格系统,这不是 cube 的出发点。相反,我们提供细节颗粒化的布局工具,方便自由使用。inline-block 组件Float 在 IE6、7 中有许多臭名昭著的 Bug,很多时候可以用 inline-block 来代替。YUI则是完全用 inline-block 来做栅格。span 元素div 元素span 元素div 元素换行符会到导致两个 ...

weixin_39609503的博客 350

CSS常见布局方式

移动端和pc端不能使用同一个页面,两个页面的布局不一致,移动端需要自己另外一个布局并使用自己另外设计一个布局并使用不同域名呈现。块级元素是垂直组织的。:不会另起一行,只要在其父级块级元素的宽度内有足够的空间,他们与其他内联元素被安排在同一行。space-around:项目位于各行之前、之间、之后都留有空白的容器内。column-reverse:与 column 相同,但是以相反的顺序。row-reverse:与 row 相同,但是以相反的顺序。row(默认值):灵活的项目将水平显示,正如一个行一样。

weixin_59528719的博客 1873

CSS的几种布局方式

概述:常用css布局方式有这几种:标准流布局、浮动布局、定位布局、弹性布局、网格布局、多列布局、响应式布局。

weixin_61149547的博客 3536
上一篇: msqli_* prevent SQL injection
下一篇: Strategy Pattern
ReZerou
博客等级 码龄10年 19粉丝 119原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值