一:
<p>
<strong>
<em>
可以两个标签叠加使用,既加斜体又加粗。
</em>
</strong>
</p>
二:
html编码:&;
①空格 ;
②<;
< (less then )
③>;
> (great then)
在文本中显示<div>
<div>
换行<br>
三:
<ol type = "1" reversed="reversed" start = "2" >
<li>
</li>
</ol>
//type只有5种。1 a A i I
reversed把列表反向排列。
start从第二个开始。
四:
<href></href>
作用:1.超链接 2.锚点 3.打电话(<a href=“tel:xxxxxx”></a>)。4.发邮件。5协议限定符。
<a href="javascript:while(1)alert('aaaa')">点</a>
五:
<input type=""></input>
type常用类型:
checkbox
password
radio
reset
submit
text
当 input 输入框获取焦点时
<input type="text" onfocus="myFunction()">
onblur resignkeybord//注销键盘。
onfocus becomeFirstResponse
input
复选框 type == checkbox
单选radio
默认选中checked="checked"
浏览器内核:
浏览器 | 内核 |
Internet Explorer(探索者) | Trident(三叉戟) |
Mozilla Firefox | Gecko |
google chrome | webkit/blink |
safari | webkit |
opera | presto |
六:css权重
!important | infinity (+1比原值大) |
行间样式 | 1000 |
id | 100 |
class 属性 伪类 | 10 |
标签 伪元素 | 1 |
通配符 | 0 |
进制 256
七:选择器
<div class="wap">
<span>
1
</span>
<div class = "box">
<span id = "only" class = "box1">
2
</span>
<em>
3
<em>
<div>
4
</div>
</div>
</div>
父子选择器
div span {
background-color:red;
}
或者用class来表示:
.wap .box span{
background-color:red;
}
也可以用id来表示。
父子选择器是指选中下属所有节点,不只是直接节点。例如:.wap span 是把1与2都选中。
直接子元素选择器:
.wap > span {
background-color:red;
}
只会选中1。
选择器查找元素是从右向左。
并列选择器:(中间不加空格)
div.wap {
}
这样只会选中1.
3种选择题共用:
//权重:1 10 1 10 1 100 10
div.wap > div[classs="box"] > span#only.box1
这是选中了2.
分组选择器:
<span>
2
</span>
<em>
3
<em>
<div>
4
</div>
span,
em,
div {
background-color:red;
}
伪类选择器:
a:hover {
}//鼠标放上去会有变化。
其他:
text-indent
首行缩进2em
text-decoration
:
none | 默认.定义标准的文本。 |
underline | 定义文本下的一条线。 |
overline | 定义文本上的一条线。 |
line-through | 定义穿过文本下的一条线。 |
blink | 定义闪烁的文本。 |
inherit | 规定应该从父元素继承 text-decoration 属性的值。 |
cursor
:鼠标类型。
CSS特性:
行级元素:inline
feature:1.内容决定元素的所占位置2.不可通过css改变宽高。
span strong em a
块级元素:block
feature:1.独占一行2.可以通过css改变宽高。
div p ul li ol form address
行级块元素:inline-block.
1.内容决定大小2.可以改变宽高。
inline与inline-block都有文字特性。
<body>
<span class="span">1</span>
<span class="span">2</span>
</body>
<style>
.span {
margin: 0px;
padding: 0px;
}
</style>
就算margin与pandding都等于0,两个span中间依然有间隔。这就是文字特性。如下图:
ul
列表 去掉大圆点list-style:none
ul
列表默认margin-top
与margin-bottom
有16px。padding-left
有40px去掉这些默认可以用通配符:
*{
margin: 0px;
padding: 0px;
}
border
:(三个属性)
{
border:5px solid red;
}