2016-11-29 21 views
1

要素を浮動させたり、インラインで表示しようとすると、それらは消えます。これがなぜなのか分かりません。これらのプロパティはかなり簡単に思えます。任意の入力は素晴らしい垂直方向ではなくインラインブロックまたは水平方向に表示

body { 
 
    background-color: grey; 
 
} 
 

 
.divison1 { 
 
    background-color:blue; 
 
    min-width: 100px; 
 
    min-height: 100px; 
 
} 
 
.division2 { 
 
background-color: green; 
 
max-width: 100px; 
 
min-height: 100px; 
 
}
<!DOCTYPE> 
 
<html> 
 
<head> 
 
    <title> Practice with divs!</title> 
 
    <link href = "style.css" type = "text/css" rel = "stylesheet"/> 
 
</head> 
 
<body> 
 
<div class = "divison1"></div> 
 
</body> 
 
</html>

答えて

1

変更するには、最大高さの最小高さ

あなたのdivの高さは、その空の

body { 
 
    background-color: grey; 
 
} 
 

 
.divison1 { 
 
    background-color:blue; 
 
    min-width: 100px; 
 
    min-height: 100px; 
 
}
<!DOCTYPE> 
 
<html> 
 
<head> 
 
    <title> Practice with divs!</title> 
 
    <link href = "style.css" type = "text/css" rel = "stylesheet"/> 
 
</head> 
 
<body> 
 
<div class = "divison1"></div> 
 
</body> 
 
</html>

ので0であるだろう
+0

善良私のああにいくつかのコンテンツを取得するためにmin-heightを設定する必要があり、-.-あなたにチラーをありがとうございました。 –

+0

あなたは大歓迎です:) – Chiller

+0

私はこれら2つの部門をフロートさせたり、インラインでそれらの1つを表示しようとすると、私に教えてもらえますか? –

0

max-heightと変更してmin-heightとします。 max-heightセットのみのdivの最大の高さは100pxにする必要はなく、ここでUはdivの

body { 
 
    background-color: grey; 
 
} 
 

 
.divison1 { 
 
    background-color:blue; 
 
    min-width: 100px; 
 
    min-height: 100px; 
 
}
<!DOCTYPE> 
 
<html> 
 
<head> 
 
    <title> Practice with divs!</title> 
 
    <link href = "style.css" type = "text/css" rel = "stylesheet"/> 
 
</head> 
 
<body> 
 
<div class = "divison1"></div> 
 
</body> 
 
</html>

関連する問題