CSS sprite 圆角——源代码
所需图片:

corners-type1 corners-type2 corners-type3 corners-type4 corners-type5 roundedbox-type5-bg
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Previe of Type - Easy rounded corners, by Ignacio Ricci (www.ignacioricci.com)</title>
<style>
body {margin:; padding:40px; font:% Georgia, "Times New Roman", Times, serif; background:#FFF;} /* Rounded-cornered divs -*/
.roundedBox {position:relative; padding:17px; margin:10px ;} /*- All the corners -*/
.corner {position:absolute; width:17px; height:17px;} /*- Each corner -*/
.topLeft {top:; left:; background-position:-1px -1px;}
.topRight {top:; right:; background-position:-19px -1px;}
.bottomLeft {bottom:; left:; background-position:-1px -19px;}
.bottomRight {bottom:; right:; background-position:-19px -19px;}
/*- Type1 - Blue -*/
#type1 {background-color:#CCDEDE;}
#type1 .corner {background-image:url(img/corners-type1.gif);} /*- Type2 - Green -*/
#type2 {background-color:#CDDFCA;}
#type2 .corner {background-image:url(img/corners-type2.gif);} /*- Type3 - Violet -*/
#type3 {background-color:#D3CADF;}
#type3 .corner {background-image:url(img/corners-type3.gif);} /*- Type4 - Red with border -*/
/* We change the corners' position and add the border */
#type4 {background-color:#CCACAE; border:1px solid #AD9396;}
#type4 .corner {background-image:url(img/corners-type4.gif);}
#type4 .topLeft {top:-1px; left:-1px;}
#type4 .topRight {top:-1px; right:-1px;}
#type4 .bottomLeft {bottom:-1px; left:-1px;}
#type4 .bottomRight {bottom:-1px; right:-1px;} /*- Type5 - With gradient -*/
/* We change the top corners' height, and the bottom corners background-position. We must also add to the containing div a gradient to repeat in x. */
#type5 {background:#FECBCA url(img/roundedbox-type5-bg.png) repeat-x ; min-height:110px;}
#type5 .corner {background-image:url(img/corners-type5.png);}
#type5 .topLeft,
#type5 .topRight {height:140px;}
#type5 .bottomLeft {background-position:-1px -142px;}
#type5 .bottomRight {background-position:-19px -142px;} </style>
</head> <body> <!-- Type1: Blue -->
<div class="roundedBox" id="type1">
<strong>My content in roundedBox Type </strong>
<div class="corner topLeft"></div><div class="corner topRight"></div><div class="corner bottomLeft"></div><div class="corner bottomRight"></div>
</div> <!-- Type2: Green -->
<div class="roundedBox" id="type2">
<strong>My content in roundedBox Type </strong>
<div class="corner topLeft"></div><div class="corner topRight"></div><div class="corner bottomLeft"></div><div class="corner bottomRight"></div>
</div> <!-- Type3: Violet -->
<div class="roundedBox" id="type3">
<strong>My content in roundedBox Type </strong>
<div class="corner topLeft"></div><div class="corner topRight"></div><div class="corner bottomLeft"></div><div class="corner bottomRight"></div>
</div> <!-- Type4: Red with border -->
<div class="roundedBox" id="type4">
<strong>My content in roundedBox Type </strong>
<div class="corner topLeft"></div><div class="corner topRight"></div><div class="corner bottomLeft"></div><div class="corner bottomRight"></div>
</div> <!-- Type5: With gradient -->
<div class="roundedBox" id="type5">
<strong>My content in roundedBox Type </strong>
<div class="corner topLeft"></div><div class="corner topRight"></div><div class="corner bottomLeft"></div><div class="corner bottomRight"></div>
</div> </body>
</html>
CSS sprite 圆角——源代码的更多相关文章
- css sprite,css雪碧图生成工具V3.0更新
V3.0主要改进 1.增加了单独添加单张图片以及删除单张图片的功能 2.增加了生成.sprite文件用以保存雪碧图信息 3.增加了打开.sprite文件功能 什么是css sprite CSS spr ...
- css sprite 调整大张图片中小图标的大小
直接说解决方法: 假设一张拼合好的大图大小是:900 x 1000 px (如上图) 现在想取图中左上角的河马图标,并缩小图标的大小. 正常取图: .sprite { background: url( ...
- HTML CSS SPRITE 工具
推荐一个CSS SPRITE工具 网盘分享:http://pan.baidu.com/s/1sjx7cZV
- CSS Sprite雪碧图应用
在写网页过程中,会遇到这种需要使用多个小图标: 如上图中的「女装」文字左边的图标.容易想到的解决方法是为每张图片加入<img>标签,但这样做会增加HTTP请求数量,影响网站加载速度.比这更 ...
- CSS雪碧,即CSS Sprite 简单的例子
CSS Sprite生成工具 http://pan.baidu.com/s/1gdGQwiJ 工具可将多幅图片整合一张,并生成CSS. HTML代码 <style> .img{backgr ...
- 使用compass自动合并css雪碧图(css sprite)
本文转载自: 使用compass自动合并css雪碧图(css sprite)
- CSS Sprite 图标
HTML <body> <!-- ul.sprite>li*5>s.s-icon+a{CSS Sprite} --> <!-- 以上是Sublime Text ...
- CSS Sprite 雪碧图制作
CSS Sprite 雪碧图,简单来说就是: 为了提高网页的性能,减少加载次数,将一些不会经常随网站内容变化的小图标,集中放在一张大图上,将该图应作为background-image 嵌入页面中,在需 ...
- CSS Sprite的优缺点分析
目前大多数的开发人员对这个技术都有相当地掌握,也有很多关于它的教程和文章.几乎所有的文章中都宣称设计师和开发人员都应该使用 CSS sprite 来减少 HTTP 请求数,并且节省一些流量.这个技术被 ...
随机推荐
- install ruby and ruby gem
sudo apt-get install ruby #find an folder and: git clone https://github.com/rubygems/rubygems.git cd ...
- iOS 基础 第三天(0807)
0807 成员变量作用域###### 如下图所示: 这里要注意手写的成员变量/实例变量默认的作用域是private,所以外部指针类型的对象无法直接访问,这起到一定的保护作用.但可以在当前类内部@imp ...
- sql之表的表达式
1.派生表 实质:就是特殊的子查询(将查询结果放在from后面) 含有一张Order表: 看下面的sql语句: select orderid,orderdate,custid from ( selec ...
- iOS 的 Gif 渲染引擎 FLAnimatedImage-b
公司的项目有个首页加载一张2M左右的git图,刚做的时候是使用的SDWebImage里面的方法: + (UIImage *)sd_animatedGIFNamed:(NSString *)name; ...
- 第一次写python
这是一个在BJDP上学习Coding Kata的时候用到的一个练习,原来打算用Java写的,但是一想正好是学习的好机会. 就用Python了.第一次,写的有些复杂. 这个题目是关于购买图书的打折信息的 ...
- 【规范】javascript 变量命名规则(转)
匈牙利命名法 语法 变量名 = 类型 + 对象描述 类型指变量的类型 对象描述指对象名字全称或名字的一部分,要求有明确含义,命名要容易记忆容易理解. 通过在变量名前面添加相应小写字母的符号标示作为前缀 ...
- HDU1432+几何
题意:给N个点,求最多有多少个点在同一直线上 方法一:求出所有能形成的直线,两两比较,统计最多有多少条重合. #include<stdio.h> #include<stdlib.h& ...
- android dialog点击其他区域消失
只需调用dialog对象的setCanceledOnTouchOutside方法,传入参数为true即可. 如下代码实现: //点击其他区域dialog消失 menuDialog.setCancele ...
- [itint5]根据前序后序遍历统计二叉树
http://www.itint5.com/oj/#28 这题有意思.一开始还想不清楚,看了解释,很棒. 这个题目的特殊之处是所有节点的值都是不一样的. 所以递归过程可以大大简化. 先看两种遍历的性质 ...
- [itint5]判断是否为二叉搜索树
http://www.itint5.com/oj/#25 这题在leetcode上是用中序遍历来做的,但是这里由于有相等的情况,即左子树小于等于根,这样中序遍历无法完全判定.可以用递归来做,用递归给出 ...