1.文字的样式
样例:
p{
/* 文字对齐方式 */
/* text-align: center; */
/* 设置大小 单位 pt pc px in cm mn*/
font-size:50px;
/* 设置字体:宋体 楷体 隶书 */
font-family: "宋体";
/* 设置字体样式:italic斜体 normal正常 */
font-style: italic;
/*颜色: */
color: blue;
/* 文字的粗细 */
font-weight: 800;
/* 文字的特殊效果 underline overline line-through */
text-decoration: line-through;
/* 文字首行缩进的百分比 */
text-indent: 2%;
}
效果:
2.图片的样式
img{
/* 图片的线框的线性 dashed dotted solid */
border-style: solid;
/* 边框的颜色 */
border-color:aqua;
/* 边框的粗细 */
border-width: 20px;
/* 将线型 颜色 粗细合并为一个语句 */
/* 例如:border:solid aqua 20px; */
/* 水平对齐方式 */
text-align: center;
/* 文字垂直对齐方式 bottom super sub middile*/
vertical-align: bottom;
/* 图片环绕文字的方式 left right */
float: left;
/* 图片与文字之间的距离 */
margin: 40px;
/* 图片的宽度 */
width: 200px;
/* 图片的高度 */
height: 400px;
}
3.设置背景颜色
.p1{
/* 设置背景颜色 */
background-color: black;
/* 设置背景图片是否可以重复出现,可以取值为
repeat-x repeat-y no-repeat repeat
*/
background-repeat: repeat-x;
/* 设置背景图片的位置 */
background-position: right;
/* 设置背景图片是否固定 默认fiexd表示被固定了 */
background-attachment: fixed;
}