从昨天晚上折腾到今天,无论修改tags.asp还是模板里的tags.html还是b_article_tag.html,都无法给每个标签加上width;论坛发帖也没解答;忍无可忍下又去找巴士飞扬,总算得以解决。
修改方法:修改根目录下的tags.asp,找到下面这段,
Dim Tag
Dim strTagCloud
For Each Tag in Tags
If IsObject(Tag) Then
strTagCloud=strTagCloud & "<span style='font-family:verdana,sans-serif;line-height:150%;font-size:"& 12 + (Tag.Count/2) &"px;margin:10px;'><a title='" & Tag.Count & "' alt='"& Tag.Count &"' href='" & Tag.Url &"'>" & Tag.name & "</a></span>"
End If
Next
替换成:
Dim Tag
Dim strTagCloud
strTagCloud="<table width=100% border=0 cellpadding=0 cellspacing=0>"
dim i
i=0
dim rowcount
rowcount=4
For Each Tag in Tags
If IsObject(Tag) Then
if i=0 then
strTagCloud=strTagCloud &"<tr height='22'>"
end if
strTagCloud=strTagCloud & "<td height='20'><span style='line-height:15px;'><a title='" & Tag.Intro & "' alt='"& Tag.Count &"' href='" & Tag.Url &"'>" & Tag.name & "-" & Tag.Count & "篇</a></span></td>"
if i=(rowcount-1) then
strTagCloud=strTagCloud &"</tr>"
end if
i=(i+1) mod rowcount
End If
Next
if i<>0 then
strTagCloud=strTagCloud & "<td colspan=""" & rowcount-i & """> </td></tr>"
end if
strTagCloud=strTagCloud &"</table>"
其中rowcount=4表示有多少列,可以按自己的皮肤需求定,td和tr的height高度可以按自己需求调整——这里我为了对其皮肤的背景横线,对的好辛苦 T.T。title='" & Tag.Intro & "'为鼠标放到tag上的效果,默认的是标签所包含的文章数,这里设置成了标签摘要。当然,摘要在在后台编辑标签写上才会有。而至于标签数还是移出来直接显示了。效果可见:http://yyld.net/blog/tags.asp