• box-sizing的学习和认识


    先上自己写的DEMO代码

    <!DOCTYPE html>
    <html>
    
    	<head>
    		<meta charset="utf-8" />
    		<title>box-sizing的学习</title>
    	</head>
    	<style>
    		.one {
    			 50px;
    			height: 50px;
    			background-color: blue;
    		}
    		
    		.two {
    			 50px;
    			height: 50px;
    			background-color: red;
    			padding: 10px;
    		}
    		
    		.three {
    			 50px;
    			height: 50px;
    			background-color: yellow;
    			padding: 10px;
    			-webkit-box-sizing: border-box;
    			-moz-box-sizing: border-box;
    			box-sizing: border-box;
    		}
    	</style>
    
    	<body>
    		<!--
            	作者:43352901@qq.com
            	时间:2016-03-22
            	描述:针对DIV 的 box-sizing的学习
            	结论:设置box-sizing时,使用的padding,不会增加DIV的整体宽高
            -->
    
    		<div class="one">1
    		</div>
    		<div class="two">2
    		</div>
    		<div class="three">3
    		</div>
    	</body>
    
    </html>
    

      

    结论:

    设置box-sizing时,使用的padding,不会增加DIV的整体宽高


  • 相关阅读:
    TCP之Nagle算法与TCP_NODELAY
    CSPS模拟 87
    CSPS模拟 86
    CSPS模拟 85
    CSPS模拟 84
    CSPS模拟 83
    CSPS模拟 82
    CSPS模拟 81
    CSPS模拟 80
    CSPS模拟 79
  • 原文地址:https://www.cnblogs.com/Mwsoft/p/5306185.html
Copyright © 2020-2023  润新知