試圖改變#Leftbar的大小,但如果我用像素或百分比來做它不會改變,所以我試着改變父母大小,以便我可以使用百分比。出於某種原因,它適用於第一個div而不是爲兄弟第二個兄弟div元素沒有繼承高度
HTML
<!DOCTYPE html>
<html lang="en">
<head class="Setup">
<link rel="stylesheet" type="text/css" href="I don't want to reveal my path but it's accurate">
</head>
<body class="Setup">
<div class="Design">
<div class="TopDesign">
<p id="Topbar"></p>
<p id="Minibar"></p>
</div>
<div class="LeftDesign">
<span id="Leftbar"></span>
</div>
</div>
</body>
</html>
CSS
* {
margin: inherit;
box-sizing: inherit;
top: inherit;
left: inherit;
font-family: Menlo;
font-style: italic;
}
html {
margin: 0px 0px 0px 0px;
box-sizing: content-box;
top: 0px;
left: 0px;
}
#Topbar {
background: rgb(255, 0, 0);
width: 100%;
height: 5em;
opacity: 0.6;
}
#Minibar {
position: fixed;
background: rgb(0, 0, 255);
width: 80%;
height: 2.5em;
top: 5em;
left: 5em;
}
#Leftbar {
background: hsl(0, 0%, 0%);
width: 5em;
height: 10em;
}
你能表現出你真正想要發生一些暗示?圖像明智。粗糙的箱子圖紙應該沒問題......但是我沒有明白你想說的。 –
http://prntscr.com/axb19s,http://prntscr.com/axb1fi和http://prntscr.com/axb1ko – Gensoki