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

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

為什么我這種寫法中間空出一大部分

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>混合布局編程挑戰(zhàn)</title>

<style type="text/css">

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

.top{height:100px;background:#ccc;}

.main{width:600px;height:800px;margin:0 auto;}

.left{ width:200px;height:800px;background:blue;position:absolute;left:0;top:100px;}

.right{height:800px;background:#9c9;margin:0 0 0 210px;}

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

</style>


</head>


<body>

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

<div class="main">

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

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

</div>

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


</body>

</html>

為什么我這樣寫了之后,left和right之間并沒有空出10px的距離,看著特別大,是網(wǎng)站顯示有問題還是我做的有問題啊。

正在回答

4 回答

查了下left:0是相對body進(jìn)行定位的,給main設(shè)置position:relative相對定位,left就會以已經(jīng)進(jìn)行定位的父元素main進(jìn)行絕對定位position:absolute;letf:0top:0;就可以用了


1 回復(fù) 有任何疑惑可以回復(fù)我~
#1

慕仰5293895 提問者

絕對定位好像要有個(gè)參照,父層要加個(gè)position:relative對吧?
2016-09-10 回復(fù) 有任何疑惑可以回復(fù)我~

最后一個(gè)參數(shù)是一個(gè)整型數(shù)組,數(shù)組格式寫錯(cuò)了,應(yīng)該newint[]{R.id.pic,R.id.text}sum0,sum =num,環(huán)num,num2,num =2數(shù)。

0 回復(fù) 有任何疑惑可以回復(fù)我~

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>混合布局編程挑戰(zhàn)</title>

<style type="text/css">

body{ margin:0; padding:0; font-size:30px; color:#fff;background:red;}

.top{height:100px;background:#999}

.main{height:500px;}

.right{height:500px;background:green;position:absolute;left:210px;right:0;}

.left{ background:#00C;height:500px;width:200px;}

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

</style>


</head>


<body>

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

<div class="main">

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

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

</div>

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


</body>

</html>


0 回復(fù) 有任何疑惑可以回復(fù)我~

我也是這樣子的 你把left:0 去掉就好了中間就只會剩下10px了

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

慕仰5293895 提問者

確實(shí)是這樣,但是為什么呢。雖然left是絕對定位,但是不應(yīng)該是在main這個(gè)區(qū)間里的絕對定位嗎,還是我對絕對定位的理解有問題。
2016-09-05 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
如何用CSS進(jìn)行網(wǎng)頁布局
  • 參與學(xué)習(xí)       209571    人
  • 解答問題       1186    個(gè)

用最簡潔的案例教你布局的那些知識,這是前端工程師基本技能

進(jìn)入課程

為什么我這種寫法中間空出一大部分

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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