Pixel Border and Percentage width in Proportion

后端 未结 7 1979
误落风尘
误落风尘 2021-02-08 14:30

I think I might already know the answer to this one but I need a sanity check!

Say I have

#gridtest{
width:590px;
}

I could change the

7条回答
  •  广开言路
    2021-02-08 14:39

    You could use an inset box-shadow instead of a border:

    box-shadow: 0px 0px 0px 10px red inset;
    

    Just pad the inside of the container to compensate.

    Edit: I write "pad" but of course if you use padding it'll throw off the box dimensions. Margin the content inside instead.

提交回复
热议问题