第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

請教下 我這是main里面right寬度已經(jīng)自適應(yīng)了 怎么把right和left 相隔為10px

請教下 我這是main里面right寬度已經(jīng)自適應(yīng)了 怎么把right和left 相隔為10px

qq_12月_0 2016-11-23 14:31:04
<style type="text/css">body{ margin:0; padding:0; font-size:30px; color:#000}.top{height:100px;background:#9FC;}.main,.left,.right{height:600px;background:#F00;}.right{float:right;margin-left:300px;background:#993;}.left{width:200px;background:#00C;}.foot{height:50px;background:#666;}</style></head><body><div class="top">21112top</div><div class="main"> ?? ? <div class="right">right</div>? ? <div class="left">left</div></div><div class="foot">foot</div>在DW里 left和right總是隔著好長的距離
查看完整描述

3 回答

?
A空城

TA貢獻(xiàn)14條經(jīng)驗 獲得超3個贊

左右DIV都自適應(yīng)布局,用百分比來定義寬度。記得要清楚浮動!

<style type="text/css">

body{ margin:0; padding:0; font-size:30px; color:#000}

.top{height:100px;background:#9FC;}

.main,.left,.right{height:600px;background:#F00; }

.main:after{display:table;clear:both}?

.right{float:right;background:#993; width:75%;}

.right_l,.left_l{width:5px; background:#F00; height:inherit}

.right_l{float:left;}

.right_r{float:right;}

.left{width:25%;background:#00C; float:left;}

.left_l{ float:right;}

.left_r{ float:left;}

.foot{height:50px;background:#666;}

</style>

</head>

<body>

<div class="top">21112top</div>

<div class="main"> ?

? ? <div class="right">

? ? ? <div class="right_l"></div>

? ? ? <div class="right_r">right</div>

? ? </div>

? ? <div class="left">

? ? ? <div class="left_l"></div>

? ? ? <div class="left_r">left</div>

? ? </div>

</div>

<div class="foot">foot</div>

</body>

查看完整回答
反對 回復(fù) 2016-11-24
?
tietth

TA貢獻(xiàn)17條經(jīng)驗 獲得超8個贊

1.左邊定寬 右邊自適應(yīng)

左邊f(xié)loat:left ? ? ? 右邊margin-left:210px

<!doctype?html>
<html>
<head>
????<style?type="text/css">
????????body{?
????????????margin:0;?
????????????padding:0;?
/*????????????font-size:30px;*/
????????????color:#000;
????????}
????????.top{
????????????height:100px;
????????????background:#9FC;
????????}
????????.main,.left,.right{
????????????height:600px;
????????????background:#F00;
????????}
????????.right{
????????	
????????	margin-left:210px;
????????	background:#993;
????????}
????????.left{
????????	width:200px;
????????	background:#00C;
????????	float:?left;
????????}
????????.foot{
????????	height:50px;
????????	background:#666;
????????}
????</style>
</head>

<body>
	<div?class="top">21112top</div>
	<div?class="main">
		<div?class="left">left</div>
		<div?class="right">right</div>
	</div>
	<div?class="foot">foot</div>
</body>??
</html>

2 絕對定位

<!doctype?html>
<html>
<head>
????<style?type="text/css">
????????body{?
????????????margin:0;?
????????????padding:0;?
/*????????????font-size:30px;*/
????????????color:#000;
????????}
????????.top{
????????????height:100px;
????????????background:#9FC;
????????}
????????.main{
????????	position:?relative;
????????}
????????.main,.left,.right{
????????????height:600px;
????????????background:#F00;
????????}
????????.right{
????????	position:?absolute;
????????	left:?210px;
????????	top:0;

????????	background:#993;
????????}
????????.left{
????????	width:200px;
????????	background:#00C;

????????}
????????.foot{
????????	height:50px;
????????	background:#666;
????????}
????</style>
</head>

<body>
	<div?class="top">21112top</div>
	<div?class="main">
		<div?class="left">left</div>
		<div?class="right">right</div>
	</div>
	<div?class="foot">foot</div>
</body>??
</html>

。。。還有一些 各有優(yōu)缺點

查看完整回答
反對 回復(fù) 2016-11-23
?
lijune

TA貢獻(xiàn)2條經(jīng)驗 獲得超0個贊

設(shè)置left右浮動就可以了

查看完整回答
反對 回復(fù) 2016-11-23
?
啊啊啊啊123

TA貢獻(xiàn)25條經(jīng)驗 獲得超8個贊

你.right{float:right; ?.left什么都沒給,自然一個在左一個在右咯 ?隔著好長的距離

查看完整回答
反對 回復(fù) 2016-11-23
?
團(tuán)醬

TA貢獻(xiàn)16條經(jīng)驗 獲得超10個贊

兩個div都左浮動:

<!doctype?html>
<html>
<head>
????<meta?charset="utf-8">
????<title>無標(biāo)題文檔</title>
????<style?type="text/css">
????????body{?margin:0;?padding:0;?font-size:30px;?color:#000}
????????.top{height:100px;background:#9FC;}
????????.main,.left,.right{height:600px;background:#F00;}
????????.right{float:left;margin-left:10px;background:#993;}
????????.left{float:left;width:200px;background:#00C;}
????????.foot{height:50px;background:#666;}
????</style>

</head>

<body>
<div?class="top">21112top</div>
<div?class="main">
????<div?class="left">left</div>
????<div?class="right">right</div>

</div>
<div?class="foot">foot</div>
</body>
</html>


查看完整回答
反對 回復(fù) 2016-11-23
  • 3 回答
  • 0 關(guān)注
  • 2332 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號