CSS3 边框

CSS3 教程 · 2019-02-28 23:12:30

CSS3 边框

用 CSS3,你可以创建圆角边框,添加阴影框,并作为边界的形象而不使用设计程序,如 Photoshop。

在本章中,您将了解以下的边框属性:

  • border-radius
  • box-shadow
  • border-image

CSS3 圆角

在 CSS2 中添加圆角棘手。我们不得不在每个角落使用不同的图像。

在 CSS3 中,很容易创建圆角。

在 CSS3 中 border-radius 属性被用于创建圆角:

这是圆角边框!

实例

在div中添加圆角元素:

div
{
border:2px solid;
border-radius:25px;
}

CSS3 盒阴影

CSS3 中的 box-shadow 属性被用来添加阴影:


实例

在div中添加box-shadow属性

div
{
box-shadow: 10px 10px 5px #888888;
}

CSS3 边界图片

有了 CSS3 的 border-image 属性,你可以使用图像创建一个边框:

border-image 属性允许你指定一个图片作为边框! 用于创建上文边框的原始图像:

在 div 中使用图片创建边框:

Border

实例

在 div 中使用图片创建边框

div
{
border-image:url(border.png) 30 30 round;
-webkit-border-image:url(border.png) 30 30 round; /* Safari 5 and older */
-o-border-image:url(border.png) 30 30 round; /* Opera */
}

新边框属性

属性 说明 CSS
border-image 设置所有边框图像的速记属性。 3
border-radius 一个用于设置所有四个边框- *-半径属性的速记属性 3
box-shadow 附加一个或多个下拉框的阴影 3

点击查看所有 CSS3 教程 文章: https://www.codercto.com/courses/l/24.html

查看所有标签

Programming the Mobile Web

Programming the Mobile Web

Maximiliano Firtman / O'Reilly Media / 2010-07-23 / $44.99

* Learn how to use your existing skills to move into mobile web development * Discover the new possibilities of mobile web development, and understand its limitations * Get detailed coverage of ......一起来看看 《Programming the Mobile Web》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具