什么是css
Cascading Style Sheet 级联样式表 表现HTML或XHTML文件样式的计算机语言 包括对字体、颜色、边距、高度、宽度、背景图片、网页定位等设定
行内样式
<p style="color:red;">style属性的应用</p>
内部样式
<CSS代码最好写在<head>的<style>标签中
<style>
p{color: re'd; }
</style>
外部样式
<link href="style.css" rel="stylesheet" type="text/css" /> 注:style.css为新建的css文件
类选择器
.red{color:green} 在style标签里面
<p class="green">
案例中常用标签
让h1里面文字居中对齐 text-align:center
取消下划线 text-decoration:none
加粗 font-weight-700
首行缩进2字符 text-indent:2em
使图片居中对齐 在父类标签<p>中加
text-alien-center