পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Wednesday, February 15, 2017

CSS3 - Box Sizing

Box sizing property is using to change the height and width of element.
since css2, the box property has worked like as shown below −
width + padding + border = actual visible/rendered width of an element's box
height + padding + border = actual visible/rendered height of an element's box

Means when you set the height and width, it appears little bit bigger then given size cause element boarder and padding added to the element height and width.

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>
It will produce the following result −
Above image is having same width and height of two element but giving result is different, cause second one is included padding property.

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>
Above sample is having same height and width with box-sizing:border-box. here result is shown below.
It will produce the following result −
Above elements are having same height and width with box-sizing:border-box so result is always same for both elements as shown above.

No comments:

Post a Comment