

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
CSS2 sizing property vs CSS3 box sizing property
Let us understand the difference between CSS2 sizing property and CSS3 box-sizing property.
CSS2 sizing property
<html> <head> <style> .div1 { width: 200px; height: 100px; border: 1px solid green; } .div2 { width: 200px; height: 100px; padding: 50px; border: 1px solid pink; } </style> </head> <body> <div class = "div1">TutorialsPoint.com</div></br> <div class = "div2">TutorialsPoint.com</div> </body> </html>
CSS3 box-sizing property
<html> <head> <style> .div1 { width: 300px; height: 100px; border: 1px solid blue; box-sizing: border-box; } .div2 { width: 300px; height: 100px; padding: 50px; border: 1px solid red; box-sizing: border-box; } </style> </head> <body> <div class = "div1">TutorialsPoint.com</div></br> <div class = "div2">TutorialsPoint.com</div> </body> </html>
- Related Questions & Answers
- CSS Box Sizing Property
- CSS3 Box Width with Box-Sizing
- Creating Layouts with Box-Sizing using CSS3
- Sizing Bootstrap pagination-* class
- CSS3 Resize Property
- CSS3 Opacity property
- CSS3 User Interface Property
- CSS3 Outline offset Property
- CSS3 rgba color property
- CSS3 HSLA color property
- CSS3 HSL color property
- CSS3 Multi-Column Property
- CSS3 Transition Shorthand Property
- Animate box-shadow CSS property
- CSS3 Multi-Column rule-width Property
Advertisements