go to  ForumEasy.com   
CSS + jQuery
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  CSS Boxes
 
Subject: CSS Boxes
Author: CyberSpider
Posted on: 04/15/2016 02:01:43 AM

Whenever device to display a visible element of your HTML document, there are actually FOUR boxes to be laid out:

  • margin-box -- the most outside one, ALWAYS TRANSPARENT (you cannot color it);
  • border-box -- this one can have colors on both front face and background;
  • padding-box -- this one can only have color on background;
  • content-box -- the most inside one which renders your element.

        div {
            background-color: #ACF;
            /* margin-box */
            margin: 10px 20px 30px 40px;  /*top right bottom left*/
            /* border-box */
            border: 30px solid #0000FF; 
            /* padding-box */
            padding: 40px; 
            /* content-box */
            color: red;
        }
    


    Try it yourself in sandbox »




    References:

  •  


     
    Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
     
    Get your own forum today. It's easy and free.