In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the solution that Baidu sharing code can not be centered horizontally. the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
It is useless to question Baidu's preference for its own products in search results, so more and more webmasters have decided to add Baidu sharing code to the site page.
However, in the middle of the code encountered a depressing thing: generally in the div layer to add style= "text-align:center;" to complete the center, but found that the commonly used method of centering is not effective for Baidu sharing code.
There are two solutions, and the final results are as follows:
The first: by adding a statement at the front of Baidu's shared code:
And then move it to the right by adjusting the width of this layer to locate the layer where Baidu sharing code is located.
The code is as follows:
The code is as follows:
Share your collection to:
QZone
Sina Weibo
Tencent Microblog
Renren Network
Document.getElementById ("bdshell_js") .src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?t=" + new Date () .getHours ()
Second: by adding an outer layer to the Baidu sharing code, that is, placing the Baidu sharing code here, it can be centered (the value of padding-left is used to fine-tune the location).
The code is as follows:
The code is as follows:
Share your collection to:
QZone
Sina Weibo
Tencent Microblog
Renren Network
Document.getElementById ("bdshell_js") .src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?t=" + new Date () .getHours ()
In this way, we can achieve the level of Baidu sharing code in the middle!
Finally, remind webmasters that in order to speed up the loading speed of the web page, it is best to put all the js files at the bottom of the page and put the contents on the page where the sharing code needs to be displayed.
On Baidu sharing code can not be horizontal center of the solution to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.