复习-css列表和表格相关属性

本文详细介绍了CSS中列表和表格的相关属性及其使用方法,包括如何设置列表样式及表格布局,例如list-style、border-collapse等,并通过实例展示了具体应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

复习-css列表和表格相关属性

css列表和表格相关属性

list-style:设置所有列表属性

list-style-image:将图像设置为列表项标记,主要有url值

list-style-position:设置列表项标记的放置位置,主要有outside和inside

list-style-type:设置列表项标记的类型,主要有disc、circle、square、decimal、decimal-leading-zero、lower-roman、upper-roman、lower-greek、lower-latin、armenian、georgian

border-collapse:表格合并为单一的边框

border-spacing:设置分隔单元格边框的距离

caption-side:设置表格标题的位置

empty-cells:设置是否显示表格中的空单元格

<style type = "text/css">
> .customers{  
> font-family:"Trebuchet MCN;  
> width:100%;  
> border-collapse:collapse;  
> }  
> .customer td, .customer th  
> {  
> font-size:13px;
> border:1px solid;  
> }  
> .customers th  
> {  
> font-size:14px;  
> text-align:left;  
> background-color:#A7C942;  
> color:#ffffff;  
> }  
> .customers tr.alt td
> {color:#000000;
> background-color:#EAF2D3;
> }
> </style>

<table class = "customer">
<tr>
<th>company</th>
<th>contact</th>
<\tr>
<tr class = "alt">
<td>baidu</td>
<td>china</td>
</tr>

#five li{
padding-left:20px;
background:url("icon1.jpg") no-repeat;
}
#tb{width:50%;height:100px;font-family:"宋体";border:1px solid red;border-spacing:20px;caption-side:bottom;empty-cells:hide;
}
#tb tr td{border:1px solid red}

<ul id = "five">
<li>football</li>
<li>baskerball</li>
<li>tennis</li>
<table id = "tb">
<caption>my table</caption>
<tr>
<td>单元格1</td>
<td>单元格2</td>
<td>单元格3</td>
</tr>
</table

 

>
posted @ 2018-04-02 10:45 Edge_of_Eternity 阅读( ...) 评论( ...) 编辑 收藏
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值