CSS控制左边固定,右边自由伸展

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档title>
<style>
.main
{position:relative;width:100%}
.left
{position:absolute;width:200px;border:solid 1px red; height:200px;}
.right
{ margin-left:200px;/*这里距离和左边宽度一样即可*/border:solid 1px red; height:200px;}
style>
head>

<body >
<div class="main">
<div class="left">
div>
<div class="right">
div>
div>

body>
html>

你可能感兴趣的:(CSS控制左边固定,右边自由伸展)