如何给边界使用css的任何元素,而不添加border-width到元素的整个宽度? [英] How to give border to any element using css without adding border-width to the whole width of element?

查看:257
本文介绍了如何给边界使用css的任何元素,而不添加border-width到元素的整个宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用css给任何元素边框而不添加border-width到元素的整个宽度?

How to give border to any element using css without adding border-width to the whole width of element?

像Photoshop一样,我们可以给stroke-和外面

Like in Photoshop we can give stroke- Inside , center and outside

我认为默认的css边框属性是中心像photoshop中心,是吗?

I think default css border properties is center like center in photoshop, am i right?

想给边框里面的盒子不在外面。并且不希望在框宽中包含边框宽度。

I want to give border inside the box not outside. and don't want to include border width in box width.

推荐答案

outline:1px solid white;

这不会增加额外的宽度和高度。

This won't add the extra width and height.

这篇关于如何给边界使用css的任何元素,而不添加border-width到元素的整个宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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