Published in:2024-10-24 |
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
meta:元数据 定义网页的设置
title:网页的标题
br:换行
hr:分割线
h1-h6:标题
p:段落
b:粗体字
i:斜体
u:下划线
del/s:删除线
sup:上标文字
sub:下标文字
img:src? 相对 网络路径 alt? title?
a:href? 完整url # #id html文件相对路径 html文件相对路径#id target: _self _blank
ul:->li type?
ol:->li type? 1 A a i I
dl:dt->dd
table:->tr->td border? cellspacing ? cellpadding?
tr: align? 文字水平对齐方式 valign文字垂直对齐方式
td: rowspan?前一个td上加rowspan colspan?
caption: 表格标题 加粗 居中
thead:->tr->th 定义表格的表头 加粗 居中
form:-> action 表单要被提交到的服务器的url
input: type->text,password,radio,checkbox,submit,reset,file,button,date,
textarea :文本域 placeholder
select:->option selected
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
插入css 样式三种方式:
1.内部 2.内联 3.外部
选择器
1.元素 元素名
2.类选择器 .类名
3.id选择器 #id名
4.派生选择器 1标签 2标签
5.儿子选择器 1标签>2标签
6.毗邻选择器 1标签+2标签 同级
7.弟弟选择器 1标签~2标签 同级
8.属性选择器
1.[属性名]
2.[属性名=值]
3.标签名[属性名=值]
9.伪类
标签名:hover
input:focus
背景样式
background-color
background-img
文本样式
text
文字样式
font
盒子模型
padding 内边距 内容与边框的距离
margin 外边距 盒子与盒子的距离
border 边框
定位
相对
相对自身原来位置做偏移
position:relative
top
绝对
div1
div2
如果想让div2固定在div1要给这个div1加一个position(前提div1是div2的父标签)
position:absolute
固定
固定在浏览器窗口上
position:fixed
top:
浮动
清除浮动
Prev:
Next: