文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

如何用CSS3来实现社交分享按钮

2024-04-02 19:55

关注

这篇文章主要讲解了“如何用CSS3来实现社交分享按钮”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“如何用CSS3来实现社交分享按钮”吧!

以前实现按钮一般都是用图片来实现的,特别是一些拥有质感的按钮,今天练习了一些相关方面的的例子,用css3来实现Social Media Buttons

html代码如下

代码如下:


<div>
<ul>
<li> <a href=" " title="My E-Mail"> <img src="images/gmail_white.png" /> <span>E-Mail</span> </a> </li>
<li> <a href="#" title="My LinkedIn Page"> <img src="images/linkedin_white.png" /> <span>LinkedIn</span> </a> </li>
<li> <a href="#" title="My Facebook Page"> <img src="images/facebook_white.png" /> <span>Facebook</span> </a> </li>
<li> <a href=“#" title="My Twitter Page"> <img src="images/twitter_white.png" /> <span>Twitter</span> </a> </li>
<li> <a href="#" title="My Flickr Page"> <img src="images/flickr_white.png" /> <span>Flickr</span> </a> </li>
</ul>
</div>

css代码如下

代码如下:


* {
margin:0;
padding:0;
}
.outset-colored {
font-family:Helvetica, Verdana, Arial, sans-serif;
font-size: 14px;
list-style-type: none;
margin: 10px 0 0 10px;
}
.outset-colored ul {
list-style-type:none;
display:block;
}
.outset-colored li {
float:left;
height:30px;
margin:0 8px 7px 0;
}
.outset-colored li a {
color:#424242;
float:left;
font-size:16px;
font-weight:bold;
height:24px;
padding-left: 27px;
padding-top: 6px;
position: relative;
text-decoration: none;
border: 1px solid #bfc1c6;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-borer-radius: 5px;
border-radius:5px;
}
.outset-colored li a img {
height:16px;
left:7px;
margin-right:7px;
position:absolute;
top:7px;
width:16px;
border:none;
}
.outset-colored li a span {
display: block;
height: 22px;
padding-right: 7px;
overflow: hidden;
}
span.site {
font-size: 14px;
line-height: 20px;
}
.outset-colored li a.email {
background:-moz-linear-gradient(#ff6666, #cc0000 10%, #c40202);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ff6666), color-stop(.10, #cc0000), color-stop(1, #c40202));
color: #f3f3f3;
border: 1px solid #c40202;
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#ff6666', endColorstr='#c40202');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#ff6666', endColorstr='#c40202')";
}
.outset-colored li a:hover.email {
background: -moz-linear-gradient(#c40202, #cc0000 1%, #e03434 10%, #e03434);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #c40202), color-stop(.01, #cc0000), color-stop(.10, #e03434), color-stop(1, #e03434));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#c40202', endColorstr='#e03434');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#c40202', endColorstr='#e03434')";
}
.outset-colored li a.linkedin {
background:-moz-linear-gradient(#7cd0fb, #38a5dc 10%, #2c83ae);
background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #7cd0fb), color-stop(.10, #38a5dc), color-stop(1, #2c83ae));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#7cd0fb', endColorstr='#2c83ae');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#7cd0fb', endColorstr='#2c83ae')";
color: #f3f3f3;
border: 1px solid #2c83ae;
}
.outset-colored li a:hover.linkedin {
background: -moz-linear-gradient(#2c83ae, #38a5dc 1%, #41b9f6 10%, #41b9f6);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #2c83ae), color-stop(.01, #38a5dc), color-stop(.10, #41b9f6), color-stop(1, #41b9f6));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#2c83ae', endColorstr='#41b9f6');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#2c83ae', endColorstr='#41b9f6')";
}
.outset-colored li a.facebook {
background: -moz-linear-gradient(#7aa3f7, #4c72c3 10%, #3b5998);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #7aa3f7), color-stop(.10, #4c72c3), color-stop(1, #3b5998));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#7aa3f7', endColorstr='#3b5998');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#7aa3f7', endColorstr='#3b5998')";
color: #f3f3f3;
border: 1px solid #3b5998;
}
.outset-colored li a:hover.facebook {
background:-moz-linear-gradient(#3b5998, #4c72c3 1%, #5c8aea 10%, #5c8aea);
background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #3b5998), color-stop(.01, #4c72c3), color-stop(.10, #5c8aea), color-stop(1, #5c8aea));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#3b5998', endColorstr='#5c8aea');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#3b5998', endColorstr='#5c8aea')";
}
.outset-colored li a.twitter {
background:-moz-linear-gradient(#8ae0fd, #24bce6 10%, #1e9ec1);
background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #8ae0fd), color-stop(.10, #24bce6), color-stop(1, #1e9ec1));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#8ae0fd', endColorstr='#1e9ec1');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#8ae0fd', endColorstr='#1e9ec1')";
color: #f3f3f3;
border: 1px solid #1e9ec1;
}
.outset-colored li a:hover.twitter {
background:-moz-linear-gradient(#1e9ec1, #24bce6 1%, #33ccff 10%, #33ccff);
background:-webkit-gradient(linear, left top, left bottom, color-stop(0, #24bce6), color-stop(.01, #33ccff), color-stop(.10, #33ccff), color-stop(1, #33ccff));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#1e9ec1', endColorstr='#33ccff');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#1e9ec1', endColorstr='#33ccff')";
}
.outset-colored li a.flickr {
background: -moz-linear-gradient(#fc75ba, #e10374 10%, #c10263);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fc75ba), color-stop(.10, #e10374), color-stop(1, #c10263));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#fc75ba', endColorstr='#c10263');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#fc75ba', endColorstr='#c10263')";
color: #f3f3f3;
border: 1px solid #c10263;
}
.outset-colored li a:hover.flickr {
background: -moz-linear-gradient(#c10263, #e10374 1%, #ff0283 10%, #ff0283);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #c10263), color-stop(.01, #e10374), color-stop(.10, #ff0283), color-stop(1, #ff0283));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#fc75ba', endColorstr='#ff0283');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#fc75ba', endColorstr='#ff0283')"; }

在firefox和chrome中预览如下:

如何用CSS3来实现社交分享按钮

在ie9中预览效果:

如何用CSS3来实现社交分享按钮

在ie6/7/8中预览效果如下:

如何用CSS3来实现社交分享按钮

感谢各位的阅读,以上就是“如何用CSS3来实现社交分享按钮”的内容了,经过本文的学习后,相信大家对如何用CSS3来实现社交分享按钮这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是编程网,小编将为大家推送更多相关知识点的文章,欢迎关注!

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     807人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     351人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     314人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     433人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     221人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯