CSS border width shrink / Prevent border size change

How can I prevent shrinking of border width in some web browsers using CSS ?

I am using CSS height, line-height and border-width.The result looks good in some web browsers, but in other browsers, the border is shrinked from 3px to 2px.
0
give a positive ratinggive a negative rating
25 Jun 2023 at 07:11 PM
Hi,

To prevent the border-width shrink, you can add box-sizing property:

width: 300px;
height: 100px;
border: solid #CCCCCC;
border-width: 0px 0px 3px 0px;
box-sizing: border-box;




0
give a positive ratinggive a negative rating
30 Jun 2023 at 11:39 AM
Tim
Share on FacebookShare on TwitterShare on LinkedInSend email
x
x
2024 AnswerTabsTermsContact us