# Border not using the defined width

**URL:** <https://forum.codewithmosh.com/t/border-not-using-the-defined-width/21785>\
**Category:** HTML/CSS\
**Created:** [July 30, 2023, 5:07pm UTC](https://forum.codewithmosh.com/t/border-not-using-the-defined-width/21785 "2023-07-30T17:07:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shukku11](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@shukku11](https://forum.codewithmosh.com/u/shukku11)\
**Post date:** [July 30, 2023, 5:07pm UTC](https://forum.codewithmosh.com/t/border-not-using-the-defined-width/21785/1 "2023-07-30T17:07:06Z")

</div>

Hi - I am following The Ultimate HTML5 & CSS3 Series: Part 2, **Chapter 3**. When I inspect the box I see the border value of **9.6** even though I set the border to the following value. Why would the browser not use the whole width? Attaching the image for reference.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/7/773181bb320f5723b737e58d7c942805e4578fee.png)

---

<div class="post-metadata">

**Author:** ![vi\_t](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vi\_t](https://forum.codewithmosh.com/u/vi_t)\
**Post date:** [August 1, 2023, 1:08pm UTC](https://forum.codewithmosh.com/t/border-not-using-the-defined-width/21785/2 "2023-08-01T13:08:54Z")

</div>

@shukku11  
I would say it’s because of the padding. Try using the following in your .box class: box-sizing: border-box;

---

<div class="post-metadata">

**Author:** ![shukku11](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@shukku11](https://forum.codewithmosh.com/u/shukku11)\
**Post date:** [August 1, 2023, 1:51pm UTC](https://forum.codewithmosh.com/t/border-not-using-the-defined-width/21785/3 "2023-08-01T13:51:13Z")

</div>

That wasn’t it ☹ I see that my code has `box-sizing` applied to all the elements, yet to no avail.

---

<div class="post-metadata">

**Author:** ![vi\_t](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vi\_t](https://forum.codewithmosh.com/u/vi_t)\
**Post date:** [August 1, 2023, 2:21pm UTC](https://forum.codewithmosh.com/t/border-not-using-the-defined-width/21785/4 "2023-08-01T14:21:36Z")

</div>

that is strange 🤔. I don’t have the same issue on my pc:  
![image|690x280](upload://4u1lPb5DBE9i1DQFWfG2pEftB8f.png
