Pixel Border and Percentage width in Proportion

后端 未结 7 1954
误落风尘
误落风尘 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:44

    Unfortunately, yes, you're out of luck. One hacky way to get around this problem is with a wrapper div that you use to create your border. So the outside div would be 57% (in your example) with a background that is the color of your desired border. Then, the inner div would have a width of 96% or so (play with the exact number to find a border that is appropriate for your design).

提交回复
热议问题