Z-Blog 博客评论框添加背景图片

zblog教程 7626

相信不少Z-Blog博客用户使用部分主题或看到部分用户主题中的文章评论框里有图片显示,有些用户也想给自己的博客评论框添加一张漂亮迷人或有个性的文字图片,博客吧说一下如何给Z-Blog评论框添加背景图片。

添加方法:

1、登陆博客后台,进入文件管理——THEMES目录——当前主题目录——TEMPLATE目录

2、找到b_article_commentpost.html文件(Z-Blog主题文件说明),用Notepad++等文本工具打开,找到以下代码:

1
<p><textarea name="txaArticle" id="txaArticle" onchange="GetActiveText(this.id);" onclick="GetActiveText(this.id);" onfocus="GetActiveText(this.id);" cols="50" rows="4" tabindex="5" ></textarea></p>

3、将以上代码替换为以下代码:

1
<p><textarea name="txaArticle" id="txaArticle"  onchange="GetActiveText(this.id);" onfocus="GetActiveText(this.id);"  class="text" cols="50" rows="4" tabindex="5"  onclick="this.style.background='#FFF'"  style="background:url(/THEMES/<span style="color: #ff0000;">default/STYLE/boke8net.gif</span>) no-repeat scroll  left top; -moz-background-clip: -moz-initial; -moz-background-origin:  -moz-initial; -moz-background-inline-policy: -moz-initial;"  onclick="GetActiveText(this.id);" ></textarea></p>

其中红色部分表示Z-Blog评论框的图片所在地方是主题文件目录的STYLE目录中。这个请根据自己博客主题情况替换掉。

3、效果:

提醒:如果博客不是安装在网站空间的根目录而是在子目录,如https://www.boke8.net/z-blog/,那么就要把代码中的图片路径修改为z-blog/THEMES/default/STYLE/boke8net.gif 或者 https://www.boke8.net/z-blog/THEMES/default/STYLE/boke8net.gif 否则评论框的背景图片无法显示。

精品推荐: