案例:CSS案例     状态:可编辑再运行    进入横版
AخA
<p><b>注释:</b>如果您只为 a 元素设置内边距(而不设置 ul 元素),那么链接会出现在 ul 元素之外。所以,我们为 ul 元素添加了 top 和 bottom 内边距。</p>
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<style>
5
ul
6
{
7
list-style-type:none;
8
margin:0;
9
padding:0;
10
padding-top:6px;
11
padding-bottom:6px;
12
}
13
li
14
{
15
display:inline;
16
}
17
a:link,a:visited
18
{
19
font-weight:bold;
20
color:#FFFFFF;
21
background-color:#98bf21;
22
text-align:center;
23
padding:6px;
24
text-decoration:none;

 运行结果 
 北美留学生论坛