0

I´m using the box-sizing: border-box; element to make my boxes on my website behave the same on multiply browsers. It has worked perfectly great since I started create the website but today the box-sizing element suddenly stopped working. I´ve no clue on what´s can be the problem. Help would be much appreciated!

Here´s a link to my website: http://amazive.com As you can see, all the boxes have put the padding "outside" instead of "inside" the boxes.

This is my reset code:

* {
    margin:0; 
    padding:0;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

Thanks, Fredrik

Suhaib Janjua
  • 3,538
  • 16
  • 59
  • 73
Akerman
  • 5
  • 4

2 Answers2

1

Loading your site I see the following error in the console:

Selector expected.  Ruleset ignored due to bad selector. main.css:1

If you look at the first line of your main.css file you'll see it is:

</*****************************************************

Remove the leading angle bracket so it looks like:

/*****************************************************
robertc
  • 74,533
  • 18
  • 193
  • 177
0

From what I gather you want box-sizing; border-box; to be on all of your elements? To do it use this code

/* apply a natural box layout model to all elements */
*, *:before, *:after {
  -moz-box-sizing: border-box; 
  -webkit-box-sizing: border-box; 
  box-sizing: border-box;
 }

Here is a codepen sample: http://codepen.io/camdixon/pen/DgrGC

I got the answer from here: http://www.paulirish.com/2012/box-sizing-border-box-ftw/

A more detailed answer and IE tricks found here: * { Box-sizing: border-box; } : To border-box or not to border-box all elements?

Community
  • 1
  • 1
camdixon
  • 852
  • 2
  • 18
  • 33