HTML & CSS
387 subscribers
728 photos
1 video
4 files
54 links
πŸ‘Œ HTML & CSS
@html_css_tut

πŸ‘ŒJavaScript
@javascript_tut

πŸ‘Œ PHP
@php_tut


πŸ‘ŒAll About Coding
@codingWithElias
Download Telegram
CSS Box Sizing

πŸ“ŒThe CSS box-sizing property allows us to include the padding and border in an element's total width and height.

πŸ’ŽWithout the CSS box-sizing Property

βœ… By default, the width and height of an element is calculated like this:

πŸ’Žwidth + padding + border = actual width of an element

πŸ’Ž height + padding + border = actual height of an element

πŸ”‘The box-sizing property allows us to include the padding and border in an element's total width and height.

πŸ”‘If you set 
box-sizing: border-box; 
on an element, padding and border are included in the width and height:

@html_css_tut
"w3schools .com"
πŸ“Œbox-sizing: border-box

πŸ“ŽThe code below ensures that all elements are sized in this more intuitive way. Many browsers already use box-sizing: border-box; for many form elements (but not all - which is why inputs and text areas look different at width: 100%;).

πŸ”‘Applying this to all elements is safe and wise:

________________

* {
  box-sizing: border-box;
}
_________________

@html_css_tut
"w3schools .com"
Heading (h1 - h6)