本篇内容介绍了“css中怎么玩转有序/无序列表项list样式”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
在无序列表ul>li中,无线列表的标志是出现在各列表前面的圆点。在有序列表ol>li中,前面默认带有数字,如何修改列表前面的项目符号,只需要通过list-style调整就好,常见的符号有(/内容注释部分/)list-style-type:circle;/空心圆/list-style:none;/去除标志/list-style:square;/方块/list-style:upper-roman;/罗马数字/list-style:lower-alpha;/list-style-type:upper-alpha;大写字母/list-style-type: decimal;/序号数字展示/等!
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>css如何玩转有序无序列表项list样式</title>
7 <style type="text/css">
8 ul.box1{
9 list-style-type:circle;
10 }
11 .box1 li{
12 list-style:none;
13 background-image: url("https://pic.cnblogs.com/avatar/1350951/20200208114706.png");
14 height: 50px;
15 background-repeat: no-repeat;
16 background-size: 20px;
17
18 padding: 0px 25px 10px;
19 }
20 ul.box2{
21 list-style:square;
22 }
23 ul.box3{
24 list-style:upper-roman;
25 }
26 ul.box4{
27 list-style:lower-alpha;
28 }
29 ol.box5{
30 list-style: none;
31 list-style:upper-alpha;
32 color: indianred;
33 }
34 </style>
35 </head>
36 <body>
37 <!-- 无线列表 -->
38 <ul class="box1">
39 <li>abc</li>
40 <li>abc</li>
41 <li>abc</li>
42 <li>abc</li>
43 <li>abc</li>
44 </ul>
45 <ul class="box2">
46 <li>abc</li>
47 <li>abc</li>
48 <li>abc</li>
49 <li>abc</li>
50 <li>abc</li>
51 </ul>
52 <ul class="box3">
53 <li>abc</li>
54 <li>abc</li>
55 <li>abc</li>
56 <li>abc</li>
57 <li>abc</li>
58 </ul>
59 <ul class="box4">
60 <li>abc</li>
61 <li>abc</li>
62 <li>abc</li>
63 <li>abc</li>
64 <li>abc</li>
65 </ul>
66 <!-- 无序列表把ul>li换成ol>li有序列表,前面默认带有数字-->
67 <ol class="box5">
68 <li>abc</li>
69 <li>abc</li>
70 <li>abc</li>
71 <li>abc</li>
72 <li>abc</li>
73 </ol>
74 </body>
75 </html>
“css中怎么玩转有序/无序列表项list样式”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注编程网网站,小编将为大家输出更多高质量的实用文章!