普通文本(比如段落)的默认大小是 16 像素 (16px=1em)。
meta设置元数据:
<meta name="author"
content="LRL">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
HTML script元素
script> 标签用于定义客户端脚本,比如 JavaScript。
script 元素既可包含脚本语句,也可通过 src 属性指向外部脚本文件。
<script type="text/javascript">
document.write("Hello World!")
</script>
XHTML标准:
1.元素必须关闭,空元素也必须关闭
2.属性必须小写,属性值必须用引号包围
CSS(Cascading Style Sheets)
css的规则主要由选择器和一条或者多条声明构成
1.选择器
selector{declaration}
2.声明
selector{property:value}
3选择器的分组
h1,h2,h3,h4,h5,h6 {color: green;}
4.摆脱定制化的继承
body {
font-family: Verdana, sans-serif;}
p {
font-family: Times, "Times New Roman", serif;}
5.id选择器(通过#定义)
#red {color:red;}
#green {color:green;}
6.派生选择器
h2 strong {
font-style: italic;
font-weight: normal;
}
<h2 style="color:pink">HAHJDAJDAHDJ <strong>ADHJS</strong></h2>
7.类选择器(用一个点号显示!!!怎么感觉和id有点点类似)
.center {text-align: center}
<h1 class="center">
This heading will be center-aligned
</h1>
8.属性选择器:(如果有title属性,可以设置属性带有的样式;如果属性带有属性值,只有属性和属性值一致才显示样式)
[title=mi]
{color:red;}
[title~=hello]{color:pink} (模糊匹配,只要属性title的值有hello就行)
<h2 title="my_special_title">aaaaaa</h2>
<a title="mimi" href="http://www.baidu.com">HHH</a>
9.设置表单的样式(属性值和单位之间不要有空格)
10.设置背景图片(可以类似派生选择器和类选择器操作,backgound-image属性不可以继承)
p.pic{background-image:url(url_link);padding:20px}
背景重复:background-repeat:repeat-y
背景定位:background-position:center,还可以设置背景的尺寸%orpx
背景锁定:background-attachment:fixed
文本缩进:text-indent:xxem
字间隔:word-spacing:npx or n em
字符转换:text-transform:none upcrase downcrase capitalize
文本装饰:text-decoration:none underline overline line-through blink
空格换行属性:white-space: none pre pre-line....
字符间距:letter-spacing:none ....
字形和字体:font-style(normal italic oblique)和font-family(常用serif)...