0

我的问题是我不能并排放置两个 div。我想要一个白色背景框,右上角有日期。图像应与日期高度相同。

这是我的代码:

#boxx {
background-color: white;
width: 768px;
 -moz-box-shadow: 5px 5px 5px #000;
    -webkit-box-shadow: 5px 5px 5px #000;
    box-shadow: 5px 5px 5px #000;
padding-left: 5px;
padding-top: 5px;
padding-bottom: 5px;
padding-right: 5px;
margin-top: 30px;
font-family: Tahoma;
font-size: 10pt;
}
#date{
text-align: right;
color: #d50a0a;
position: relative;
}

#image{
margin-left: 5px;
position: float;
margin-bottom: 5px;
margin-right: 5px;
}

当我尝试它时,图像总是在日期下方一行。我怎么解决这个问题?

4

1 回答 1

0

而不是放

position:float;

尝试

float:left;

(或根据需要正确)

于 2012-10-11T14:44:37.423 回答