CSS学习笔记--段落格式化

时间:2022-09-21 23:19:52

段落格式化:

行间距:line-height : 150%;   //   1.5, 2em, 20px        

对齐文本:text-align :   // left, right, center, justify

首行缩进:text-indent : 20px;text-index : 5em;

控制段落间距:p { margin-top : 0;   margin-bottom : 0}

格式化段落的首字母或首行:p : first-letter { font-weight : bold;    color: red;}

给特定段落的首字母设置样式:如 .intro:<p class="intro">Text for introductory paragaph goes here....</p>

然后创建一个具名样式, 如   .intro:first-letter { text-transform : uppercase;}

如何给列表定义样式:

用项目符号表示无序列表:disc, circle,  square

表示有序列表有6种: decimal, decimal-leading zreo, upper-alpha, lower-alpha, upper-roman, lower-

romanlist-style-type : square;list-style-type : upper-alpha;

隐藏项目符号:list-style-type : none;

给项目符号定位: list-style-position : outside;list-style-position : inside;

消除所有列表缩进:ul, ol {  padding-left : 0 ;  margin-left: 0;}

指定url图片路径list-style-image : url(images/bullet.gif);