1 回答

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超10個(gè)贊
.left {
float: left;
width: 30px;
background-color: green;
}
.right {
float: right;
background-color: red;
width: 30px;
}
<div class="left">Text</div>
<div class="right">Text</div>
你必須使用浮動(dòng)來實(shí)現(xiàn)這一點(diǎn)
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<style>
.left {
float: left;
width: 30px;
background-color: green;
}
.right {
float: right;
background-color: red;
width: 30px;
}
</style>
</head>
<body>
<div class="left">Text</div>
<div class="right">Text</div>
</body>
</html>
- 1 回答
- 0 關(guān)注
- 178 瀏覽
添加回答
舉報(bào)