
首先表格除了常用的tr、td标签外,还有th和caption标签,前者是用来显示列名称,后者用来显示表格标题。这2个标签的增加,可以更方便的对表格css进行控制。
下面是表格边框的css写法:
table
{
border-collapse:collapse;
}
table, td, th
{
border:1px solid black;
}
这是单元格文字垂直居中的css写法:
td
{
height:50px;
vertical-align:middle;
}
另外还有个合并表格边框线的css
table
{
border-collapse:collapse;
}
列表用的比较多的是ul li,最近看到用dl dt dd,其实跟表格那个一样,是一种能更多控制的列表方式,多了个dt来表示标题
<dl> <dt>新闻快讯</dt> <dd>子主题</dd> <dd>文章管理</dd> <dt>活动通知</dt> <dd>子主题</dd> <dd>文章管理</dd> </dl>
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
These cookies are needed for adding comments on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com
You can find more information in our Cookie Policy and Cookie Policy.