centering FB html5 code
Trying to get h开发者_如何学运维tml5 code from Facebook Like box centered.
Here is the default code:
<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_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs); }(document, 'script',
'facebook-jssdk'));</script> <div class="fb-like-box"
data-href="http://www.facebook.com/mycreditdoctor" data-width="460"
data-show-faces="true" data-stream="false" data-header="false"></div>
I have tried searching this site and google but must not be putting in the right keywords (I am also a beginner in html)
The wordpress plugin allows me to just paste in a script, so it is easy to get this to show up, but it is left aligned.
Can someone please let me know what you can add to this html script so that it will be center aligned?
Stick the code in a <center>
... </center>
.
I changed the data-width
to a smaller value (should be proportional to the section you want to center) and used the <center>
tag before the <div class>
class.
the center tag may be depreciated but it's the only one that works in this case. CSS techniques don't seem to have any effect.
精彩评论