当前位置: 代码迷 >> Web前端 >> Marging Border Background Padding Context懂得
  详细解决方案

Marging Border Background Padding Context懂得

热度:617   发布时间:2012-11-06 14:07:00.0
Marging Border Background Padding Context理解
  • CSS代码
  • body{
    background:yellow;
    }
    
    #outside{
     width:500px;
     height:500px;
     background:red;
     margin:50px;
     padding:80px 40px 80px 40px;
     border-style:solid;
     border-width:40px 60px 40px 60px;
     border-color:blue;}
     
    #inside {
     width:200px;
     height:200px;
     background:green;
     margin:50px;
     padding:80px;
     border-style:solid;
     border-width:20px;
     border-color:gray;}
    
    ?
  • HTML例子
  • <html>
    	<head>
    		<link rel="stylesheet" type="text/css" href="css/test.css"/>
    		<title>css test</title>
    	</head>
    	<body>
    		<div id="outside">
    			this is outside div
    			<div id="inside">
    				this is inside div
    			</div>
    		</div>
    	</body>
    </html>
    ?
  相关解决方案