CSS borders interfering with absolute positioning

后端 未结 3 1275
悲哀的现实
悲哀的现实 2021-02-19 00:01

[edit: clarified that box-sizing: border-box doesn\'t seem applicable, since I\'m using absolute positioning]

The following code illustrates my problem. I\'m using absol

3条回答
  •  臣服心动
    2021-02-19 00:22

    Try out CSS2 outline property:

    .bordered {
        outline:2px solid blue;
    }
    

    Outline does not affect element position.

    You can also use CSS3 outline-offset as seen here: http://www.css3.info/preview/outline/

提交回复
热议问题