CSS3媒体图标

This is an experiment that creates social media icons using CSS and semantic HTML. It uses progressive enhancement to turn an unordered list of text links into a set of icons without the use of images or JavaScript.

The CSS file used in the demo page is commented to explain what is going on.

See the demo: Pure CSS social media icons

CSS social media icons

The image below shows you the final appearance in modern browsers.

A preview of the social media icons created using CSS

This experiment starts with a simple list of links, with each link using meaningful text, and then progressively styles each link to take on the appearance of the relevant social media icon. As a result, there should be support for screenreaders or users with CSS disabled.

I’ve also included basic text in the title attribute of each link to provide information for users who may not be familiar with what service a specific icon represents.

This is an experiment that uses CSS2.1 and CSS3 that is not supported by Internet Explorer 6 and 7, therefore, you shouldn’t expect it to work in those browsers. CSS is not necessarily the most appropriate tool for this kind of thing either.

Example code

The technique I’ve used is much the same as the one used for the pure CSS speech bubbles.

The HTML is just a basic unordered list of links to various social networking websites or services.

<ul>
   <li class="facebook"><a href="#non" title="Share on Facebook">Facebook</a></li>
   <li class="twitter"><a href="#non" title="Share on Twitter">Twitter</a></li>
   <li class="rss"><a href="#non" title="Subscribe to the RSS feed">RSS</a></li>
   <li class="flickr"><a href="#non" title="Share on Flickr">Flickr</a></li>
   <li class="delicious"><a href="#non" title="Bookmark on Delicious">Delicious</a></li>
   <li class="linkedin"><a href="#non" title="Share on LinkedIn">LinkedIn</a></li>
   <li class="google"><a href="#non" title="Bookmark with Google">Google</a></li>
   <li class="orkut"><a href="#non" title="Share on Orkut">Orkut</a></li>
   <li class="technorati"><a href="#non" title="Add to Technorati">Technorati</a></li>
   <li class="netvibes"><a href="#non" title="Add to NetVibes">NetVibes</a></li>
</ul>

I’ve applied some general styles to the elements that make up this list.


ul {
   list-style:none;
   padding:0;
   margin:0;
   overflow:hidden;
   font:0.875em/1 Arial, sans-serif;
}

ul li {
   float:left;
   width:66px;
   height:66px;
   margin:20px 20px 0 0;
}

ul li a {
   display:block;
   width:64px;
   height:64px;
   overflow:hidden;
   border:1px solid transparent;
   line-height:64px;
   text-decoration:none;

   /* css3 */
   text-shadow:0 -1px 0 rgba(0,0,0,0.5);
   -moz-border-radius:5px;
   -webkit-border-radius:5px;
   border-radius:5px; /* standards version last */
}

ul li a:hover,
 ul li a:focus,
 ul li a:active {
   opacity:0.8;
   border-color:#000;
}

Each icon uses it’s own set of styles. This is the CSS that created the RSS icon.

.rss a {
   position:relative;
   width:60px;
   padding:0 2px;
   border-color:#ea6635;
   text-transform:lowercase;
   text-indent:-186px;
   font-size:64px;
   font-weight:bold;
   color:#fff;
   background:#e36443;

   /* css3 */
   -moz-box-shadow:0 0 4px rgba(0,0,0,0.4);
   -webkit-box-shadow:0 0 4px rgba(0,0,0,0.4);
   box-shadow:0 0 4px rgba(0,0,0,0.4);
   background:-webkit-gradient(linear, left top, left bottom, from(#f19242), to(#e36443));
   background:-moz-linear-gradient(top, #f19242, #e36443);
   background:linear-gradient(top, #f19242, #e36443);
}

/* create circle */
.rss a:before {
   content:"/00a0";
   position:absolute;
   bottom:10px;
   left:10px;
   width:12px;
   height:12px;
   background:#fff;

   /* css3 */
   -moz-border-radius:12px;
   -webkit-border-radius:12px;
   border-radius:12px;
}

/* create the two arcs */
.rss a:after {
   content:"/00a0";
   position:absolute;
   bottom:10px;
   left:10px;
   width:22px;
   height:22px;
   border-style:double;
   border-width:24px 24px 0 0;
   border-color:#fff;

   /* css3 */
   -moz-border-radius:0 50px 0 0;
   -webkit-border-radius:0 50px 0 0;
   border-radius:0 50px 0 0;
}

Acknowledgements

This post was inspired by an experiment on insicdesigns that producing a few social media icons using CSS. Their experiment did not use semantic HTML, meaningful text, or degrade nicely in a semi-modern browser like Internet Explorer 8. This is my attempt to remedy that.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: H5 CSS3移动端漂亮登录界面的设计可以从以下几个方面入手: 1. 选择合适的颜色搭配:通过选择适合移动端的配色方案,可以营造出舒适、清新的登录界面。一般来说,可以选择明亮的颜色作为主题色,搭配柔和的中性色作为背景色,使整个界面色彩协调。 2. 使用特效增加动感:在登录界面中使用CSS3动画与过渡效果,可以增加视觉上的动感。例如,在输入框获取焦点时可以添加缓慢的闪烁效果,或者在表单验证成功时添加弹跳的动画效果。 3. 采用响应式布局:为了适应不同的移动设备屏幕大小,可以使用响应式布局设计登录界面。通过媒体查询和流式布局,使界面能够自动适应各种大小的屏幕,确保在不同设备上都能展现良好的用户体验。 4. 添加背景图或渐变效果:为登录界面添加合适的背景图或渐变效果可以提升整体的美感。可以选择与主题相关的图片作为背景,或者使用CSS3实现的渐变效果,使界面更加丰富多样。 5. 设计简洁明了的UI元素:登录界面的UI元素应该简洁明了,避免过多复杂的装饰与图标。只保留必要的输入框、按钮和文字说明等元素,使用户能够快速理解和使用登录界面。 总之,一个漂亮的H5 CSS3移动端登录界面应该有舒适的色彩搭配、合适的特效动画、响应式布局、精心选择的背景和简洁明了的UI元素等元素的组合,能够给用户带来良好的视觉体验和操作体验。 ### 回答2: 要设计一个漂亮的H5 CSS3移动端登录界面,有几个关键点需要注意: 首先,要选择合适的颜色和字体,以营造出视觉上的吸引力和舒适感。可以选择亮丽的主色调,如蓝色或绿色,并搭配简洁清晰的字体。 其次,界面布局要简洁明了,不宜过于复杂。可以使用简单的网格布局来放置登录表单的元素,如用户名和密码输入框、登录按钮、忘记密码等。 在动效方面,可以运用CSS3的动画效果,让界面更加生动有趣。例如,在输入框获得焦点时,可以添加一些渐变或者缩放效果。登录按钮可以使用渐变色或者阴影效果,并在点击时添加弹出或者变色的动画。 另外,登录界面应该具备良好的交互性和易用性。可以通过添加实时输入提示、自动填充或者密码可视化等功能来提升用户体验。还可以在输入错误时,以动画的方式给出错误提示,并联动键盘出现/消失。 最后,需要保证登录界面在各种移动设备上的适配性。可以使用响应式设计来调整界面布局和样式,确保在不同屏幕尺寸下都有良好的显示效果。 总之,设计漂亮的H5 CSS3移动端登录界面需要考虑颜色、字体、布局、动效、交互性和适配性等多个方面。只有将这些因素综合考虑,才能设计出令人满意的登录界面。 ### 回答3: 移动端的登录界面在设计上有很多创意和灵感可以融入,通过使用H5和CSS3的特性,可以创建漂亮而且吸引人的登录界面。 首先,可以利用CSS3中的渐变特性为登录界面添加背景色。可以使用线性渐变或径向渐变来创建各种炫目的背景效果,使登录界面更加醒目和吸引人。 其次,可以使用CSS3中的动画特性为登录界面添加动态效果。例如,可以使用过渡特性实现元素的平滑过渡和渐变效果,或者使用关键帧动画实现元素的连续动画效果,例如按钮的闪烁或图标的旋转。 另外,可以使用H5提供的表单元素和属性来优化登录界面的交互体验。例如,可以使用输入类型属性设置输入框的类型,例如邮箱、密码或电话号码,并使用placeholder属性为输入框提供提示信息。还可以使用required属性设置字段为必填项,使用pattern属性限制输入的格式。 此外,可以使用H5中的LocalStorage或SessionStorage来实现记住密码的功能。用户在登录后选择记住密码,可以将其用户名和密码保存在本地存储,以便下次打开应用时自动填充登录信息。 最后,还可以使用H5提供的响应式布局和媒体查询功能来适配不同尺寸的屏幕,使登录界面在不同设备上都能够呈现出最佳的显示效果。 总之,通过巧妙地运用H5和CSS3的特性,可以设计出漂亮而且充满创意的移动端登录界面,提升用户的使用体验和吸引力。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值