简单教程
提交运行
代码编辑器:
<!DOCTYPE htm> <meta charset="utf-8"> <link href="https://cdn.bootcss.com/bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet"> <style>.socials { padding: 10px;}</style> <div id="fb-root"></div> <script>(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container" style="width:auto"> <ul class="nav"> <li class="active"> <a href="#">简单教程</a> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> Bootstrap <b class="caret"></b> </a> <ul class="dropdown-menu"> <li><a href="#">Bootstrap 2 </a></li> <li><a href="#">Bootstrap 3</a></li> <li><a href="#">Bootstrap 4</a></li> </ul> </li> </ul> <form class="navbar-search pull-left"> <input type="text" class="search-query" placeholder="搜索"> </form> <ul class="nav pull-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> Social <b class="caret"></b> </a> <ul class="dropdown-menu"> <li class="socials"><!-- 将这个标签放置在要渲染的+ 1按钮的位置 --> <g:plusone annotation="inline" width="150"></g:plusone> </li> <li class="socials"><div class="fb-like" data-send="false" data-width="150" data-show-faces="true"></div></li> <li class="socials"><a href="https://twitter.com/share" class="twitter-share-button">Tweet</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></li> </ul> </li> </ul> </div> </div> </div> <script src="/static/lib/bootstrap/2.3.2/docs/assets/js/jquery.js"></script> <script src="/static/lib/bootstrap/2.3.2/docs/assets/js/bootstrap.min.js"></script> <script>$(document).ready(function () {$('.dropdown-toggle').dropdown();});</script> <script> (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script>
运行结果: