使2个div 在一行上显示

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>CSS</title>
    <link href="~/Content/Home.css" rel="stylesheet" /> 
 
</head>
<body>
    <div>
        <div class="div-1 "></div> 
        <div class="div-2  "></div>
    </div>
</body>
</html>

CSS样式

.div-1 {
    background-color:lavender;
    width: 40%;
    height: 400px;
  float: left;
}

.div-2 {
    background-color: yellowgreen;
    width: 60%;
    height: 400px;
   
}

 

posted @ 2015-03-26 10:42  逍遥帝君  阅读(764)  评论(0编辑  收藏  举报