Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Box-sizing not working. Why?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #43158
    CodeGraphics
    Participant

    Pls check this [codepen](http://codepen.io/anon/pen/foscy “”). The box-sizing:border box is not working.
    Must I make .left 480px for it to work?

    #127033
    pixelgrid
    Participant

    you are not including a box-sizing property to your codepen.maybe it is to your style sheet but you have a relative path . also have a look here to see teh box-sizing browser support http://caniuse.com/#search=box-sizing

    #127034
    ChrisP
    Participant

    @CodeGraphics, you don’t have the `box-sizing: border-box;` declaration _anywhere_ in your CSS. You have to put it in for it to work.

    #127037
    CodeGraphics
    Participant

    I added it, but it’s not working. Check the[ codepen.](http://codepen.io/anon/pen/ouLAp “”)

    #127040
    wolfcry911
    Participant

    It is working. You’re not getting the results you expect, but it’s working…

    With the switch to border-box box-sizing, the padding and borders are contained within the width (so the header with the same width of the wrap is going to overflow to the right because of wrap’s borders). The floats won’t fit next to each other because of the margin on the first float – box-sizing has no effect on margins.

    This pen can easily be made without the switch to border-box – why are you using it? (It’s not wrong to use, but I suggest you know why you’re using before changing to it)

    #127042
    CodeGraphics
    Participant

    Ok.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.