HTML&CSS Learning Notes 6
来源:互联网 发布:淘宝茶叶为什么便宜 编辑:程序博客网 时间:2024/06/05 10:01
CSS
Basic III
Box Model display
property. Generally there are two features, block model and single element. Block model is like that whether the content is empty or not the width of the div decorated by block will be follow the rule we sat. Single means one element populate the full width, only one element stand in one line.
block
: block model(like a box no matter the content), single element.
inline-block
: block model, non-single element.
inline
: none-block model(width depends on the content), non-single element.
none
: disappear.
Four parts of Box Model
Margin
The margin is the space around the element. The larger the margin, the more space between our element and the elements around it. We can adjust the margin to MOVE our HTML elements closer to or farther from each other.
Border
The border is the edge of the element. It’s what we’ve been making visible every time we set the border property.
Padding
The padding is the spacing between the content and the border. We can adjust this value with CSS to MOVE the border closer to or farther from the content.
Content
The content is the actual “stuff” in the box.
Parameters of Margin/Padding
According the order, up, right, down and left to Margin and Padding. auto
is to center the content in horizontal.
Special setting for certain direction is like margin-[direction]
.
Parameter of Border border: [width] [type] [color]
, negative number means moving to opposite direction.
Float
You can think of the HTML page as sort of like a sea, and floating elements as boats on it: all the boats have positions on the sea, and they all see and steer clear of each other. left
and right
are the two parameters. If you have several elements, they all know the others are there and don’t land on top of each other.
clear
For example, there are three elements they across each other. If you type clear:left
for the center one. It will move below for clear the left side of this center element, but doesn’t matter for right side. Same to right
parameter for opposite result. Similarly both
can clear both sides of the element.
Positioning absolute
Absolute positioning element, relate to the first parent element which is not static.
fixed
Absolute positioning element, relate to the browser.
relative
Relative positining element, relate to itself to move (flow position).
static
Default flow element, not positioning element.
Circle
border-radius:[percentage]
, curving of corner.
- HTML&CSS Learning Notes 6
- HTML&CSS Learning Notes 1
- HTML&CSS Learning Notes 2
- HTML&CSS Learning Notes 3
- HTML&CSS Learning Notes 4
- HTML&CSS Learning Notes 5
- HTML&CSS Learning Notes 2 (Additional)
- HTML Learning Notes
- HTML learning notes
- Learning HTML+CSS
- Python chapter 6 learning notes
- Learning Notes
- Css Notes
- CSS notes
- HTML notes
- Html Notes
- LEARNING NOTES FROM DEEP LEARNING
- notes of 30 days to learn html &css
- Java变量和常量基础
- 生成树
- [iOS]如何在iOS开发中切换显示语言实现国际化
- OJ 模板-java
- SpriteBuilder中的loadAsScene:方法的返回值
- HTML&CSS Learning Notes 6
- linux命令-pwd
- Sharesdk中模拟机不显示QQ空间、微信朋友圈,以及图标下面app名称为英文的解决办法
- maven 使用maven profile实现多环境可移植构建
- [boost] Windows下编译
- YARN原理及其工作流程
- POJ 1422 Air Raid (最小路径覆盖)
- linux下 /etc/profile、~/.bash_profile ~/.profile的执行过程
- 华为OJ试题:输入一行字符,分别统计出包含英文字母、空格、数字和其它字符的个数