如何使用CSS3制作内边框? [英] How can I make inner border using CSS3?

查看:120
本文介绍了如何使用CSS3制作内边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用CSS3创建内边框?

How can I make an inner border using CSS3?

也就是说,不是从元素的活动/填充区域向外延伸的边框,它向内延伸,重叠其内容?

That is, instead of the border extending outwards from the active/padding area of the element, it extends inwards, overlapping its contents?

如果可以使用最少的CSS规则,我会感激的。

I'd appreciate it if it could be done with a minimum of CSS rules, if it is possible at all.

推荐答案

尝试使用box-shadow(和供应商特定的子集)。

例如:

Try using the box-shadow (and vendor specific subsets).
For example:

-moz-box-shadow: inset #B3B3B3 0 -1px 0 0;
-webkit-box-shadow: inset #B3B3B3 0 -1px 0 0;
box-shadow: inset #B3B3B3 0 -1px 0 0;

这篇关于如何使用CSS3制作内边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆