html第六章

盼盼的胖胖      2022-02-10     199

关键词:

第六章 盒子模型

1.什么是盒子模型:

    CSS中盒子模型的概念就是,CSS将网页中所有元素都看成一个个盒子。 

2.盒子模型的边框、内边距和外边距属性:

盒子模型的属性

图示

边框

border

 

内边距

Padding

外边距

margin

height

width

 

3.盒子模型层次关系:

①首先是盒子的主要标识:边框(border)位于盒子的第一层

 

②其次是元素内容(content)、内边距(padding)两者位于第二层

③再次是背景图(background-image)位于第三层

④背景色(background-color)位于第四层

⑤最后是整个盒子的外边距(margin)

 

4.边框的3个属性(颜色color、粗细width、样式style)

border-color(边框颜色)属性设置方法

属性

说明

示例

border-top-color

上边框颜色

border-top-color:#369;

border-right-color

右边框颜色

border-right-color:#369;

border-bottom-color

下边框颜色

border-bottom-color:#fae45b;

border-left-color

左边框颜色

border-left-color:#efcd56;

border-color

 

四个边框为同一颜色

border-color:#eeff34;

上、下边框颜色:#369

左、右边框颜色:#000

border-color:#369 #000;

上边框颜色:#369左、右边框颜色:#000

下边框颜色:#f00

border-color:#369 #000 #f00;

上、右、下、左边框颜色:

#369、#000、#f00、#00f

border-color:#369 #000 #f00 #00f;

注意:使用border-color属性同时设置4条边框的颜色时,设置顺序是按顺时针方向:上、右、          下、左。

border-width(边框粗细)属性设置方法

(它的值的:thin:设置细的边框 medium:默认值,设置中等边框。 Thick:设置粗边框 和像素值px)

属性

说明

示例

border-top-width

设置上边框的粗细为5px

border-top-width:5px;

border-right- width

设置右边框的粗细为10px

border-right-width:10px;

border-bottom- width

设置下边框的粗细为8px

border-bottom-width:8px;

border-left- width

设置左边框的粗细为22px

border-left-width:22px;

border- width

 

设置4个边框的粗细为5px

border-width:5px;

上、下边框的粗细为:20px

左、右边框的粗细为:2px

border-width:20px 2px;

上边框的粗细为:5px左、右边框的粗细为:1px下边框的粗细为:6px

border-width:5px 1px 6px;

上、右、下、左边框的粗细为:

1px 3px 5px 2px

border-width:1px 3px 5px 2px;

 

border-style(边框样式)属性设置方法

属性

说明

示例

border-top-style

设置上边框为实线

border-top-style:solid;

border-right-style

设置右边框为实线

border-right- style: solid;

border-bottom-style

设置下边框为实线

border-bottom- style: solid;

border-left-style

设置左边框为实线

border-left- style: solid;

border-style

 

设置4个边框为实线

border- style: solid;

上、下边框为实线

左、右边框为点线

border- style:solid  dotted;

上边框为实线,左、右边框为点线,下边框为虚线。

border- style:solid  dotted dashed;

上、右、下、左边框为:

实线,点线,虚线,双线

border- style:solid dotted dashed double

border属性简写:

  border-color ,border-width ,border-style顺序没有限制,但通常顺序为:粗细、颜色和样式

例:border-bottom:9px , #F00 , dashed;

5.外边距属性设置:

margin(外边距)属性设置方法

属性

说明

示例

margin-top

设置上外边距

margin-top:1px;

margin -right

设置右外边距

margin -right: 2px;

margin -bottom

设置下外边距

margin -bottom: 2px;

margin -left

设置左外边距

margin -left: 1px;

margin

 

设置上下左右外边距分别是3px 5px 7px 4px

margin:3px 5px 7px 4px;

上、下外边距 3px

左、右外边距 5px

margin: 3px 5px;

上外边距3px,左、右外边距4px, 下外边距7px。

margin: 3px 5px 7px;

上、右、下、左外边距均为8px:

margin: 8px;

6.内边距属性设置:

padding(内边距)属性设置方法

属性

说明

示例

padding-top

设置上外边距

padding -top:1px;

padding -right

设置右外边距

padding -right: 2px;

padding -bottom

设置下外边距

padding -bottom: 2px;

padding -left

设置左外边距

padding -left: 1px;

padding

设置上下左右外边距分别是3px 5px 7px 4px

padding:3px 5px 7px 4px;

上、下外边距 3px

左、右外边距 5px

padding: 3px 5px;

上外边距3px,左、右外边距8px, 下外边距10px。

padding: 3px 8px 10px;

上、右、下、左外边距均为10px:

padding:10px;

 

7.盒子模型的尺寸:

  

 

盒子模型总尺寸:border+width+padding+margin+内容宽度

8.村准文档流:

   标准文档流由块级元素和内联元素组成。

标准文档流

①块级元素

自动换行

例如:<ul></ul><p></p><h1>~<h6><div>

②内联元素

不自动换行

例如:<span><a></a><img/><strong>

Display的属性

block

块级元素的默认值,元素会被显示为块级元素,该元素前后会带有换行符

inline

内联元素的默认值,元素会被显示为内联元素,该元素前后没有换行。

none

设置元素不会被显示

       

 

例:

 

 

 

第六章

第六章编译预处理三种形式的命令:头文件,文件包含,条件编译命令宏定义:#define #undef       emmm写不下去了,下周补回来 查看详情

第六章脑图

查看详情

操统5第六章/第七章

6.18readcount同步保护? 哲学家吃饭问题https://wenku.baidu.com/view/90e0bb7f1711cc7931b716f9.html管程  死锁BridgeCrossingExample互为条件的进程发生的死锁/饿死现象四个必要条件:占有和等待死锁是两个/两个以上的进程之间的关系(... 查看详情

第六章项目进度管理

查看详情

第六章-网络编程-粘包(代码片段)

1.粘包:多个包多个命令的结果粘到一起了因为recv1024限制了导致的结果参考:http://www.cnblogs.com/linhaifeng/articles/6129246.html粘包底层原理分析:1.运行一个软件和哪几个硬件有关硬盘内存cpu2.启动程序:硬盘程序加载到内存启一个软... 查看详情

第六章树和二叉树

查看详情

数学基础——概论第六章

查看详情

第六章 图(a)概述

  查看详情

第六章 图(b1)邻接矩阵

  查看详情

blog5.第六章图的认识

一、图的存储结构图的数组(邻接矩阵)存储表示:优点:1/0表示方便缺点:不利于增加删除顶点特殊:时间复杂度较高,不稀疏图;不过在无向图,可利用下三角形来压缩处理空间。例子1:(需要辅助数组)来源:https://www.cnblog... 查看详情

第六章数组

ArraySegmentSampleusingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceArraySegmentSample{classProgram{staticvoidMain(){int[]ar1={1,4,5,11,13,18};int[]ar2={3,4,5,18,2 查看详情

云计算第六章

FundamentalCloudSecurity基本云安全BasicTermsandConcepts§Informationsecurityprotectstheintegrityofandaccesstocomputersystemsanddata.信息安全:保护计算机系统和数据的完整性和对它们的访问。§ITsecuritymeasuresaimtodefendagainstthreatsand 查看详情

第六章,上机3

1usingSystem;2usingSystem.Collections.Generic;3usingSystem.Linq;4usingSystem.Text;5usingSystem.Threading.Tasks;67namespaceWindowsFormsApplication18{9publicclassEmployee10{11publicintAge{get;set;}12pub 查看详情

第六章,上机2

1usingSystem;2usingSystem.Collections.Generic;3usingSystem.Linq;4usingSystem.Text;5usingSystem.Threading.Tasks;67namespaceShangji28{9publicclassEmployee10{11publicintAge{get;set;}12publicGenderGender{ 查看详情

第六章,上机1

1usingSystem;2usingSystem.Collections.Generic;3usingSystem.Linq;4usingSystem.Text;5usingSystem.Threading.Tasks;67namespaceShang_18{9publicclassTruck:Vehicle10{11publicTruck(stringtype,stringplace):bas 查看详情

第六章

 第六章for语法:for(表达式①;表达式②;表达式③){       //④循环操作}表达式含义:表达式1:赋值语句,它用来给循环变量赋初值例如:inti=1;表达式2:循环条件,一个关系表达式,它决定什么时候退出循环例如:i&... 查看详情

第六章,上机4

1usingSystem;2usingSystem.Collections.Generic;3usingSystem.Linq;4usingSystem.Text;5usingSystem.Threading.Tasks;67namespaceShangji_48{9///<summary>10///父类11///</summary>12publicclassOperati 查看详情

翻译文章第六章4-7

VisualizinganSVMfit格式化SVMTovisualizethebuiltmodel,onecanfirstusetheplotfunctiontogenerateascatterplotofdatainputandtheSVMfit.Inthisplot,supportvectorsandclassesarehighlightedthroughthecolorsymbol.Inad 查看详情