0

親ボックス内に2つのdivを取得しました。

上のボックスに親ボックスの 70% を、2 番目のボックスに残りの 30% を割り当てたいと思います。絶対位置を使用したくありません。

何か案は?

**********************
* top div            *
* top div            *
* top div            *
* top div            *
* top div            *
* top div            *
**********************
* bottom div         *
**********************

編集: 親ボックスはフローティングです。

#mright {
    width : 45%;
    float:right;
    margin-right: 5%;
}
4

3 に答える 3

0

はい、float を作成します。両方の div を残します。お気に入り:

#parentDiv{ width:100%; }
#topDiv{ width:70%; }
#bottomDiv{ width: 30%; }
#topDiv,#bottomDiv{ float:left; }
于 2013-07-16T15:54:58.580 に答える