2016-06-17 3 views
-1

私はまだこのレイアウトのものを使いこなそうとしていますが、私が理解したと思ったときに、このdivを表示することはできません。CSS Layout Mainbody not appearing

私は簡単なナビゲーションとフッタとメインとメインが表示されていません。黒い背景があると思われますが、現れていません。ここではフィドルは次のとおりです。

https://jsfiddle.net/44655gw4/2/

html { 
    height: 100%; 
} 




body{ 
    height: 100%; 
    background-color: #527a7a; 
    margin: 0; 
    font-family: courier; 
    font-size: 19px; 
} 


* { 

margin: 0; 

} 

#pagewrap { 

min-height: 100%; 
margin-bottom: -174px; 
width: 80%; 

} 

#pagewrap:after { 

content: ""; 
display: block; 

} 

#footer, #pagewrap:after { 

height: 174px; 

} 




.sub:last-child { 
    border: 0px; 
} 

#footer { 
background-color: #999999; 
clear: both; 

} 

.wrap { 
    margin: 0 auto; 
    width: 100%; 
    display: flex; 
    align-items: center; 
} 

.sub { 
    padding: 12px; 
    width: 32%; 
    height: 150px; 
    background: #999999; 
    color: white; 
    border-right: solid white 1px; 
} 


.sub:last-child { 

    border: 0px; 
} 




#nav { 
    list-style: none; 
    font-weight: bold; 
    width: 10%; 
    text-align: center; 
    background-color: #bfbfbf; 
    padding-right: 20px; 
    height: calc(100vh - 174px); 
    float: left; 


} 

#nav ul { 
    list-style-type: none; 
    margin: 0px; 
    padding: 0; 
    overflow: auto; 
    background-color: #bfbfbf; 
} 
#nav li { 
    margin: 0px; 

} 
#nav li a { 
    padding: 10px; 
    display: block; 
    text-decoration: none; 
    font-weight: bold; 
    color: pink; 
    background-color: #bfbfbf; 

} 
#nav li a:hover { 
    color: white; 
    text-shadow: 2px 2px 4px white; 
} 

#content { 

    width: 500px; 
    height: 100%; 
    float: right; 
    background-color: black; 


} 

<body> 
<div id="pagewrap"> 

     <div id="nav"> 
      <ul> 
       <li><a href="#">Home</a></li> 
       <li><a href="#">Works</a></li> 
       <li><a href="#">About</a></li> 

      </ul> 




     </div> 

    <div id="content"></div> 








    </div> 







<!-- 
<footer id="footer"> 

</footer> 

--> 
<hr> 

<div id="footer"> 
    <div class="wrap"> 
     <div class="sub">Lorem Ipsum</div> 
     <div class="sub">Lorem Ipsum </div> 
     <div class="sub">Lorem Ipsum </div> 
    </div> 
</div> 


</body> 
+0

メインとはどういう意味ですか?あなたはメインコンテンツを意味しますか? – dazunE

+0

@dazunEはいサー。私は自分の投稿を編集しました。 IDの 'content'の黒の背景ボックスはそこにあるはずですが、それは何らかの理由ではありません。 –

+0

あなたはどこにいるのですか?メインは何もしなかった。 – Shadow

答えて

0

#contentについて

#content { 
    width: 82%; 
    background: red; 
    float: left; 
    height: 100%; 
} 

と#nav

#nav { float;left;} 

を追加するための追加ここでは、完全なマークアップが

です

html { 
 
\t height: 100%; 
 
} 
 

 

 

 

 
body{ 
 
\t height: 100%; 
 
\t 
 
\t margin: 0; 
 
\t font-family: courier; 
 
\t font-size: 19px; 
 
} 
 

 

 
* { 
 

 
margin: 0; 
 

 
} 
 

 
#pagewrap { 
 

 
min-height: 100%; 
 
margin-bottom: -174px; 
 

 
} 
 

 
#pagewrap:after { 
 

 
content: ""; 
 
display: block; 
 

 
} 
 

 
#footer, #pagewrap:after { 
 

 
height: 174px; 
 

 
} 
 

 

 

 

 
.sub:last-child { 
 
    border: 0px; 
 
} 
 

 
#footer { 
 
background-color: #00e600; clear: left; 
 
} 
 

 
.wrap { 
 
    margin: 0 auto; 
 
    width: 100%; 
 
    display: flex; 
 
    align-items: center; 
 
} 
 

 
.sub { 
 
    padding: 12px; 
 
    width: 32%; 
 
    height: 150px; 
 
    background: #00e600; 
 
    color: white; 
 
    border-right: solid white 1px; 
 
} 
 

 

 
.sub:last-child { 
 

 
\t border: 0px; 
 
} 
 

 

 

 

 
#nav { 
 
    height: calc(100vh - 174px); 
 
    list-style: none; 
 
    font-weight: bold; 
 
    width: 10%; 
 
    text-align: center; 
 
    background-color: brown; 
 
    float:left; 
 
    padding-right: 20px; 
 

 
} 
 

 
#nav ul { 
 
    list-style-type: none; 
 
    height: 100%; 
 
    margin: 0px; 
 
    padding: 0; 
 
    overflow: auto; 
 
    background-color: brown; 
 
} 
 
#nav li { 
 
    margin: 0px; 
 

 
} 
 
#nav li a { 
 
    padding: 10px; 
 
    display: block; 
 
    text-decoration: none; 
 
    font-weight: bold; 
 
    color: pink; 
 
    background-color: brown; 
 

 
} 
 
#nav li a:hover { 
 
    color: white; 
 
    text-shadow: 2px 2px 4px white; 
 
} 
 

 
#content { 
 
     width: 82%; 
 
    background: red; 
 
    float: left; 
 
    height: 100%; 
 
}
<div id="pagewrap"> 
 

 
     <div id="nav"> 
 
      <ul> 
 
       <li><a href="#">Home</a></li> 
 
       <li><a href="#">Works</a></li> 
 
       <li><a href="#">About</a></li> 
 

 
      </ul> 
 

 

 

 

 
     </div> 
 

 
    <div id="content"> 
 
     
 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
 

 

 
    </div> 
 

 

 

 

 

 

 

 

 
    </div> 
 

 

 

 

 

 

 

 
<!-- 
 
<footer id="footer"> 
 

 
</footer> 
 

 
--> 
 
<hr> 
 

 
<div id="footer"> 
 
    <div class="wrap"> 
 
     <div class="sub">Lorem Ipsum</div> 
 
     <div class="sub">Lorem Ipsum </div> 
 
     <div class="sub">Lorem Ipsum </div> 
 
    </div> 
 
</div>