div佈局之左定寬右自適應

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>左定寬右自適應</title>
		<style type="text/css">
		    *
		    {
		    	padding: 0px;
		    	margin: 0px;
		    	border: 0px;
		    }
		    body
		    {
		    	width: 100%;
		    	height: 100%;
		    	clear: both;
		    }
		    .g-hd
		    {
		    	width: 100%;
		    	height: 30px;
		    	background-color: yellow;
		    }
		    .g-left
		    {
                        width: 200px;
                        height: 500px;
                        background-color: green;
                        float: left;
                        border-right: 3px solid pink;
                        display: table-cell;
                        position: relative;
		    }
		    .g-right
		    {
                        width: 100%;
                        height: 500px;
                        background-color: red;
                
		    }
		    .ft
		    {
		    	width: 100%;
		    	height: 30px;
		    	background-color: blue;
		    	float: left;
		    }	
		</style>
	</head>
    <body>
        <div class="g-bd">
            <div class="g-hd">
                 	
            </div>
            <div class="g-ct">
                <div class="g-left">
                	
                </div>
                <div class="g-right">
                	
                </div>	
            </div>
            <div class="ft">
            	
            </div>	
        </div>	
    </body>
</html>


    

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章