我看到過像我這樣的幾個問題,但他們都沒有成功回答。我的問題可能很簡單,但我沒有得到我的錯誤。Flexboxs兒童溢出父母
我在彼此中使用幾個柔性盒。當我改變瀏覽器大小時,它應該調整大小相同的方式。但是,在一個點兒童滿溢父母柔性盒 - 醜陋
因爲我沒有找到我的錯誤,我開始了一個新的HTML文檔 - 我仍然有錯誤。 「遊戲盒」的孩子們沒有按我的意願去做。
這裏有一個小提琴:Live-Demo
謝謝你的幫助 - RoetzerBub
html , body, main {
margin: 0;
padding: 0;
min-height: 100%;
min-width: 100%;
}
body{
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
header, footer{
display: flex;
min-width: 100%;
justify-content: center;
}
header{
flex-shrink: 0;
background-color: #cc0000;
color: white;
z-index: 10;
margin-bottom: 10px;
}
main{
display: flex;
justify-content: center;
align-items: center;
}
footer{
background-color: #444444;
color: white;
flex-shrink: 0;
z-index: 10;
margin-top: 10px;
}
/*as*/
.gamebox{
display: flex;
flex-direction: row;
min-width: 30%;
max-width: 45%;
border: 2px solid #b30000;
justify-content: space-between;
align-items: center;
}
.gb_left, .gb_center, .gb_right{
margin: 2%;
justify-content: space-around;
background-color: yellow;
}
.gb_left{
display: flex;
justify-content: space-between;
align-items: center;
flex-grow: 1;
}
.gb_right{
display: flex;
justify-content: space-between;
align-items: center;
flex-grow: 1;
}
.gb_center{
display: flex;
flex-direction: column;
justify-content: space-between;
}
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="flexstyle.css">
</head>
<body>
<header>HEADER</header>
<main>
<div class="gamebox">
<div class="gb_left">
FLAG
TEAM-A
</div>
<div class="gb_center">
type<br/>
SCORE<br/>
date
</div>
<div class="gb_right">
TEAM-B
FLAG
</div>
</div>
</main>
<footer>FOOTER</footer>
</body>
</html>
謝謝:) - 幫我 – RoetzerBub
@RoetzerBub這是走的方式,我可以看到這是最好的回答如我所說w3c規範說只有解決方案是設置最小寬度 –