test for box–width

testarea

This is test box1, to see how wide this box will be in various browsers.

This box should be 250px wide, border to border.

This is test box2, testing a css–3 declaration.

This box should be 250px wide, border to border.

code for both boxes

  1. div#box, div#box2 {
  2. color:#222;
  3. background: #efefef;
  4. border: 5px solid #333;
  5. padding: 20px;
  6. margin: 20px;
  7. }

code for box1 — using the SBMH

  1. div#box1 {
  2. div#box1 { width: 200px;}
  3. div#box1 { \width: 250px;}
  4. div#box1 { w\idth: 200px;}
  5. }

code for box2 — using a ccs–3 declaration

  1. div#box2 {
  2. width: 250px;
  3. box-sizing: border-box;
  4. -moz-box-sizing: border-box;
  5. }

 

Comments