论坛首页 Web前端技术论坛

CSS+Js在段落文字最后自动加入隐藏文字

浏览 1751 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2014-07-30  

CSS和JavaScript控制段落最后自动添加指定的隐藏文字,不建议这样用,因为对搜索引擎不太友好。不过作为一项技巧来研究,下面帖出具体的代码,以供参考指正:资源分享

01 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
02 <html xmlns="http://www.w3.org/1999/xhtml">
03 <head>
04 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
05 <title>自动加入隐藏文字</title>
06 <style>
07 .test {color:#fff;margin-left:18px;}
08 </style>
09 </head>
10 <body>
11 <p>在文章各个段落的最后加入带连接的隐藏文字</p>
12 <p>在文章各个段落的最后加入带连接的隐藏文字</p>
13 <script>
14 function test()
15 {
16 var myP = document.getElementsByTagName("p");
margin: 0px !important; padding: 0px !important; border: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; height: auto !important; width: aut
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics