如何在HTML中添加社交媒体图标

在你的网站上添加社交媒体图标是一个很好的方法 make connections 与你的客户通过社交网络,以一种非正式的方式获得他们的反馈 and involve them in your company’s life.


需要一些很酷的数据可视化想法? PPT presentation slides will get the job done.


如何在HTML中添加社交媒体图标

有多种方法可以在你的网站上添加社交媒体图标:

  • 添加图标作为所需格式的图像- .png, .svg or .eps.
  • Add them using icon fonts - FontAwesome, Glyphicons etc.
  • 使用WP小部件实现图标.
  • 通过WP插件添加社交媒体图标.

你可以选择一个最适合你的,或者尝试所有的.


添加社交图标作为图像(PNG, SVG, EPS等).)

如果你是一个设计师,你可以自己创建或定制图标. But if you’re not, 或者只是想节省时间, 您可以使用许多可以选择图标的服务 packs and download them. The most popular are:

Vecteezy

vecteezy

选择图标包 most relevant 根据您的要求下载它.

然后将文件上传到媒体库并添加它们 in 以下方法(适用于HTML网站):

See the Pen
SMIcons5
by Helen (@CF-251)
on CodePen.

并添加一些样式来调整图标的大小和位置:

.social-icons {
  text-align: center;
  }  
.social-icons li {
  display:inline-block;
  list-style-type:none;
  -webkit-user-select:none;
  -moz-user-select:none;
  }
.social-icons li a {
  border-bottom: none;
  }
.social-icons li img {
  width:70px;
  height:70px;
  margin-right: 20px;
}

Flaticon
Flaction

将图标添加到您的集合中,下载它们并 incorporate them into your code in the same way as the previous case.

IconFinder

iconfinder

你可以找到很多免费的社交游戏 icon packs here, too. 只要找到你更喜欢的风格,把他们添加到你的社交圈子里,享受吧 increased 社交网络中的人气!

有一种方法可以将社交图标应用为SVG图像. 看看下面的例子,看看如何定制它们:

See the Pen
SMIcons5
by Helen (@CF-251)
on CodePen.

See the Pen
SMicons6
by Helen (@CF-251)
on CodePen.


添加社交图标作为图标字体| html社交媒体按钮

FontAwesome

FontAwesome可能是当今最流行的图标字体. 它非常容易实现和使用. Let’s look at an example.

Add this code to your HTML:


 

将样式添加到您的样式中.CSS文件(你可以添加你自己的,或者使用这个例子):

body {
   text-align: center;
 } 
.wrapper {   
display: inline-flex;   
justify-content: center; 
} 
.wrapper i {   
padding: 10px;   
文本-阴影:0px 6px 8px rgba(0,0,0,0.6);   
过渡:所有缓进缓出150ms; 
} 
.wrapper a:nth-child(1) {   
color: #dd4b39; 
} 
.wrapper a:nth-child(2) {   
color: #4867AA; 
} 
.wrapper a:nth-child(3) {   
color: #1DA1F2; 
} 
.wrapper i:hover {   
margin-top: -3px;   text-shadow: 0px 14px 10px rgba(0, 0, 0, 0.4); 
} 

And this is how it works:

See the Pen
SMIcons7
by Helen (@CF-251)
on CodePen.

顺便说一下,你可以在 FontAwesome Cheatsheet.

实施的例子:

See the Pen
SMIcons1
by Helen (@CF-251)
on CodePen.

See the Pen
SMIcons2
by Helen (@CF-251)
on CodePen.

See the Pen
SMIcons3
by Helen (@CF-251)
on CodePen.


Socicon

另一种方法是使用Socicon图标字体.

Go to the website:


并应用如下样式:

.socicons-list {
list-style: none;  
display: flex;  
justify-content: center;
} 
.socicons-list li {
margin: 30px 10px;
} 
.socicons-list li a {
text-decoration: none;  
padding: 30px;  
font-size: 30px;  
border-radius: 50%;  
color: #fff;  
background-color: #f1f1f1;  
过渡:所有缓进缓出150ms;
} 
.socicons-list li a:hover {
文字-阴影:0 5px 10px #212121;
} 
.social -list li:n -child(1) a {
background-color: #3e5b98;
} 
.social -list li:n -child(2) a {
background-color: #c13584;
} 
.Socicons-list li:n -child(3) a {
background-color: #4da7de;
} 
.social -list li:n -child(4) a{background-color: #dd4b39;} 
.social -list li:n -child(5) a{background-color: #1769ff;} 

点击演示查看使用情况:

See the Pen
SMIcons4
by Helen (@CF-251)
on CodePen.

使用WP小部件实现图标

如果你的网站建立在WordPress上,有一个很好的方法来添加一个带有社交图标的块 using a WordPress widget. 长话短说,看看这个教程:


使用WP插件添加社交媒体图标

你可以看看不同的插件,这可能是有用的,在添加社交帐户到您的页面在这里 用于添加社交媒体图标的WordPress插件.

Pay attention to 社交媒体分享按钮弹出 & Pop Up Social Sharing Icons plugin by UltimatelySocial, 该工具为您节省了大量的时间,当添加图标集到您的网站:

I hope this article was useful to 你可以随意留下你关于添加社交图标的不同方法的评论!


Premium Social Media Icons

750企业管理图标集

Download | og体育首页ONE


Web App Icons Set

Download | og体育首页ONE


黑色圈社交媒体图标集

Download


Website Use Icon Set

Download | og体育首页ONE


50 Social Network Icon Set

Download | og体育首页ONE


50个女人平长阴影图标集

Download | og体育首页ONE


Unoline Iconset template

Download | og体育首页ONE


45数字网页线填充图标集

Download | og体育首页ONE


Round Application Icon Set

Download | og体育首页ONE


8 -数字网络线两种颜色的图标集

Download | og体育首页ONE


P.S. 只是为了确保你能得到 design studio templates in the right place.


常见问题:html社交媒体按钮

为什么我的网站需要社交媒体图标?

社交媒体在推广和宣传你的网站方面非常有帮助. 如果你的品牌有社交媒体账户,那么明智的做法是给网站访问者一个加入他们的机会,并在他们的时间轴上分享你的帖子.

What is an icon font?

它是一种仅由图标组成的字体. 这些图标可以用来在你的页面上添加社交媒体按钮.

我应该给网站添加什么样的社交媒体账号?

当选择社交媒体来建立你的品牌账号时,你必须考虑谁会是你的受众? 在大多数情况下,一个Facebook页面、Instagram帐户、linkedin和Twitter就足够了.


另请阅读:html社交媒体按钮


Helen Marshall

Helen是Templateog体育首页的技术作家,对WordPress和创建聊天机器人充满热情. Follow her on Quora.

Get more to your email

订阅我们的时事通讯和访问独家内容和提供只提供给og体育首页Post订户.

From was successfully send!
Server error. Please, try again later.

Leave a Reply