首发站点 扶凯[http://www.php-oa.com]

wordpress中使用WP-Syntax加亮代码

上一篇 / 下一篇  2008-03-24 11:37:00 / 个人分类:WordPress

通过以下地址取得WP-Syntax,将其放入wp-content/plugins/下。 http://wordpress.org/extend/plugins/wp-syntax 编辑当前主题的CSS,加入以下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.wp_syntax {
 
color: #100;
 
background-color: #f9f9f9;
 
border: 1px solid silver;
 
margin: 0 0 1.5em 0;
 
overflow: auto;
 
}/* IE FIX */
 
.wp_syntax {
 
overflow-x: auto;
 
overflow-y: hidden;
 
padding-bottom: expression(this.scrollWidth >
this.offsetWidth ? 15 : 0);
 
width: 100%;
 
}
 
.wp_syntax table {
 
border-collapse: collapse;
 
}
 
.wp_syntax div, .wp_syntax td {
 
vertical-align: top;
 
padding: 2px 4px;
 
}
 
.wp_syntax .line_numbers {
 
text-align: right;
 
background-color: #def;
 
color: gray;
 
overflow: visible;
 
}
 
/* potential overrides for other styles */
 
.wp_syntax pre {
 
margin: 0;
 
width: auto;
 
float: none;
 
clear: none;
 
overflow: visible;
 
}

使用方法:<pre lang="LANGUAGE" line="1">代码</pre>


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar