对于CSS的理解
CSS的基础理解:
css的样式类型有三个分别是外部样式表/链入样式表;头部样式表;行内样式表,这三种样式表每一个都有不同的作用,当然对我而言我更喜欢外部样式表,外部样式表又叫链入样式表,我之所以喜欢他的原因是因为方便一点,对于主结构的代码更能直观简便的看出,打个比方当你写HTML代码时,只需将你写好的代码放入css代码文件里就行,然后从HTML代码中编写link语句引入css代码即可,(即<link rel="stylesheet" type="text/css" href="lgw.css">)这样就能避免css代码和HTML代码的“冲突”,简单明了很多,如果css代码错误的话,查询错误时直接找到css代码去查询就可以。
<link rel="stylesheet" type="text/css" href="lgw.css">(引入)
css代码:body{margin: 0;background: #f8f9fc;}
#green{
width: 100%;
height: 360px;
background: #00b38a;
}
标签选择器
h1 一级标题
h2 二级标题
h3二级标题
h4 二级标题
h5 二级标题
h6 二级标题
id选择器
<div id="father">
<div id="son1"></div>
<div id="son2"></div>
</div>
class类名选择器
<h1 class="important">
This heading is very important.
</h1>
<p class="important">
This paragraph is very important.
</p>
浙公网安备 33010602011771号