diff --git a/boxsizing/index.html b/boxsizing/index.html new file mode 100644 index 0000000..80783da --- /dev/null +++ b/boxsizing/index.html @@ -0,0 +1,57 @@ + + + + + + + + + box sizing - tew-0x00 + + + + + + + +
+
+ +
+
+

box sizing

+
+

Here's a div that uses CSS box sizing property, in which the width and height properties are accounted for including content, border and padding values.

+

Other relevant properties to are initial that sets the property to its default value, and inherit.

+
+
+
#divboxsizing1 {
+    background-color: #5b7efa;
+    border-radius: 7px;
+    padding: 3em;
+    min-height: 100px;
+    margin: 0 3em;
+    box-sizing: border-box;
+}
+
+

The same thing - only without box-sizing.

+

Notice how the same padding value (3em) balooned up the height of the div, as opposed to the previous example, where it got absorbed.

+
+
+
#divnoboxsizing {
+    background-color: #5b7efa;
+    border-radius: 7px;
+    padding: 3em;
+    min-height: 100px;
+    margin: 0 3em;
+}
+
+
+ + + diff --git a/css/style.css b/css/style.css index 5053bf6..12f960b 100644 --- a/css/style.css +++ b/css/style.css @@ -549,6 +549,24 @@ pre { #divmultiplecolumns p { text-align: left; } + +#divboxsizing { + background-color: #5b7efa; + border-radius: 7px; + padding: 3em; + min-height: 100px; + margin: 0 3em; + box-sizing: border-box; +} + +#divnoboxsizing { + background-color: #5b7efa; + border-radius: 7px; + padding: 3em; + min-height: 100px; + margin: 0 3em; +} + @media screen and (max-width: 768px){ #divmultiplecolumns{ -webkit-column-count: 1; diff --git a/index.html b/index.html index ff73303..13b7095 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@
  • transitions
  • animations
  • multiple columns
  • -
  • box sizing
  • +
  • box sizing
  • flexbox