簡體   English   中英

我的部分不會出現

[英]My section won't show up

我正在切薩皮克灣上建一個網站,但即使它有background-color ,也不會彈出一個section

我不確定為什么,這在制作網站之前從未發生過。 我正在使用Atom編寫我的代碼,使用Notepad ++編譯它,然后使用Chrome來顯示它。

我的代碼:

 section { background-color: #75c776; width: 200; height: 400; margin-right: 500px; margin-top: 25px; border-radius: 3px; } 
 <header> <h1 class="title">The Cheasapeake Bay</h1> </header> <section> </section> <footer> </footer> 

如果有人可以幫我弄清楚什么是錯的,我將不勝感激!

你忘了添加px在你的CSS,有一個重復的-right

新的CSS

section {
  background-color: #75c776;
  width: 200px;
  height: 400px;
  margin-right: 500px;
  margin-top: 25px;
  border-radius: 3px;
}

新的Codepen

您需要添加widthheight屬性的單位:

width: 200px;
height: 400px;

widthheight需要有單位。

所以你錯過了widthheight的單位

您可以添加px / em / rem / vw

 section { background-color: #75c776; width: 200px; height: 400px; margin-right: 500px; margin-top: 25px; border-radius: 3px; } 
 <header> <h1 class="title">The Cheasapeake Bay</h1> </header> <section> </section> <footer> </footer> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM