用CSS做圆角的一个例子

css|圆角

HTML代码<!DOCTYPEhtml PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="//www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"/><title>无标题文档</title><style type="text/css"><!--/* START - first example */ /* set millions of background images */.rbroundbox { background:#FF9900; }.rbtop div { background: url(/static/round/006//tl.gif) no-repeat topleft; }.rbtop { background: url(/static/round/006//tr.gif) no-repeat topright; }.rbbot div { background: url(/static/round/006//bl.gif) no-repeatbottom left; }.rbbot { background: url(/static/round/006//br.gif) no-repeat bottomright; } /* height and width stuff, width not really nessisary. */.rbtop div, .rbtop, .rbbot div, .rbbot {width: 100%;height: 15px;font-size: 1px;}.rbcontent { margin: 0 15px; }.rbroundbox { width: 50%; margin: 1em auto; }/* END - first example */ --></style></head><body><div class="rbroundbox"><div class="rbtop"><div></div></div><div class="rbcontent"> <h2>Corners</h2><p>This is a sample</p><p>Of a rounded box</p><p>With funny corners</p> </div><!-- /rbcontent--><div class="rbbot"><div></div></div></div><!-- /rbroundbox --></body></html>
 

CSS:
/* START - first example */ /* set millions of background images */
.rbroundbox { background: url(images/c00.gif) repeat; }
.rbtop div { background: url(images/c11.gif) no-repeat top left; }
.rbtop { background: url(images/c12.gif) no-repeat top right; }
.rbbot div { background: url(images/c21.gif) no-repeat bottom left; }
.rbbot { background: url(images/c22.gif) no-repeat bottom right; } /* height and width stuff, width not really nessisary. */
.rbtop div, .rbtop, .rbbot div, .rbbot {
width: 100%;
height: 7px;
font-size: 1px;
}
.rbcontent { margin: 0 7px; }
.rbroundbox { width: 50%; margin: 1em auto; }
/* END - first example */
HTML:
<div class="rbroundbox">
<div class="rbtop"><div></div></div>
<div class="rbcontent"> <h2>Corners</h2>
<p>This is a sample</p>
<p>Of a rounded box</p>
<p>With funny corners</p> </div><!-- /rbcontent -->
<div class="rbbot"><div></div></div>
</div><!-- /rbroundbox -->

思路:首先我们要做五张图片四个是圆角和一个背景图片,在HTML中我们定义了三层DIV,第一个DIV里面套三个DIV,里面的第一个和第三DIV又分别套用一个DIV,一和三都是用来定义四个图片的,而中间DIV则为内容区。.rbtop定义一个背景图顶左,它里面的也定义一个背景图顶右。下面的第三组DIV 同理。这样我们的圆角就做好了,大功告成!对了,忘记了那个最外面的DIV在加入平铺的背景图,我们在这里的就是一个蓝色的色块。

可安全运行的浏览器:Win: IE5.5-6, Opera6-7.2, Netscape6-7, Mozilla1-3. Mac: IE 5.2, Safari, Camino .7 and OmniWeb 4.5.

时间: 2024-09-08 09:58:46

用CSS做圆角的一个例子的相关文章

CSS select样式优化一个例子

CSS 下拉选择菜单基本的CSS样式不怎么好看,通过一些简单的样式优化,可以得到上面的样式,不兼容IE6样式,因为用到了opacity.  代码如下 复制代码  <section class="dguide">         <div class="inner">             <div class="dguide-form clearfix">                 <div cl

CSS高级技巧:圆角矩形

所谓的CSS高级技巧...其实是一些对基本技巧的创意组合, 任何手段和技巧都是解决问题的方法. 只要学会这种思考问题的方法, 你也能拥有属于自己的CSS秘籍. CSS2 还没有办法创造出曲线边框, 明显的, 仅仅方框是没办法满足我们设计师的. 所以CSS圆角技术到现在还是那么的火. 1. 固定宽度的纯色圆角矩形 .Com 在众多圆角技术中, 固定宽度的圆角矩形应该是最容易实现的, 只需要2个图片以及一段简单的html代码. html代码如下: .Com <div class="wrappe

网页代码讲解:CSS实现圆角

文章简介:用DIV+CSS实现圆角. 用DIV+CSS实现圆角. <style> div.bg{color:#fff;font-size:18px;font-weight:700;background:#ff3300;width:50%} b{display:block;} /*将所有b标签转成块级元素*/  div b.topb b,div b.bottomb b{height:1px;overflow:hidden;background:#ff3300;} /*div标签内类名为topb/

如何实用css制作圆角

css制作圆角教程,有html代码和css全部代码. 不用图片,只用css制作圆角的另一方法. html代码: <div class="curvedBox"> <span> <span class="r1" ></span> <span class="r2" ></span> <span class="r3" ></span> &l

给你一个例子:FileFilter接口的使用。

原问题:怎么检查服务器的c:\是否有test.jpg这个文件(不知道扩展名)===================首先,定义一个FileFilter的实例    private static FileFilter fileFilter=new FileFilter(){        public boolean accept(File pathname) {            String tmp=pathname.getName().toLowerCase();            i

一个例子

一个例子这一章,我们要把我们已学的知识集合起来.具体来讲,我们来写一个使用ODBC APIs的程序.为简单起见,这个程序中我使用Microsoft的Access数据库(Microsoft Access 97) . 下载例子源程序. 注意:如果你使用的windows.inc 是1.18及其以下版本,在开始编译之前要修改其中的一个小bug.在windows.inc中查找 "SQL_NULL_HANDLE",将得到下面这行: SQL_NULL_HANDLE equ 0L 将0后面的"

javascript-js中怎么让点击事件触发前移除定时器,等点击完后再继续执行,我做的是一个轮播器

问题描述 js中怎么让点击事件触发前移除定时器,等点击完后再继续执行,我做的是一个轮播器 window.onload=function() { var oPicList=document.getElementById("picList"); var oCss=document.getElementById("css"); var aBtns=document.getElementById("btns").getElementsByTagName(

div+css做企业网站系列教程之一

中介交易 http://www.aliyun.com/zixun/aggregation/6858.html">SEO诊断 淘宝客 云主机 技术大厅 跟天豪学div+css做企业网站系列之一 现在做网站流行用什么写网页代码?用table做网站已经不流行了,现在流行用什么做网站吗?接下来, 跟天豪学div+css做企业网站,你可以学到div+css为什么会那么流行用来做网站. 我们先从简单的企业网站讲起,用div+css来写网页代码. 所有网站第一步:构思 不管你是用word还是用ps,或者

怎样用一个例子讲解StarUML中的用例图、类图、时序图 ?

问题描述 怎样用一个例子讲解StarUML中的用例图.类图.时序图 ? 老师让我讲解StarUTML中的用例图.类图.时序图 , 我不想让老师失望 , 求解啊 请大家能给我一个简单例子 谢谢了