Dynamic 动态宽度容器上的节宽度相等?
(html/css) 如何设置一个动态宽度的容器,但其中的每个部分都具有相同的宽度,以便它们与容器同时调整大小Dynamic 动态宽度容器上的节宽度相等?,dynamic,width,containers,equals,Dynamic,Width,Containers,Equals,(html/css) 如何设置一个动态宽度的容器,但其中的每个部分都具有相同的宽度,以便它们与容器同时调整大小 .container{ width:80%; } .section{ position:relative; float:left; width: 80%/6; <---- pseudo code } .container{ 宽度:80%; } .科{ 位置:相对位置; 浮动:左; 宽度:80%/6;我最近开始自己进行web开发。 不过,我希望这个答案能对你有所帮助 If yo
.container{
width:80%;
}
.section{
position:relative;
float:left;
width: 80%/6; <---- pseudo code
}
.container{
宽度:80%;
}
.科{
位置:相对位置;
浮动:左;
宽度:80%/6;我最近开始自己进行web开发。
不过,我希望这个答案能对你有所帮助
If your class="section" is within your class="container" , your browser will
assume that your class="section" width is part of it's parent. It's parent is in
this case the class="container".
.container{
width:80%;
}
The class="container" width is based upon the width of it's parent.
The correct formula for this is: target/context=result
Thus your class="container" width is in this case 80% and this based on the width
of the parent of your class="container".
Your class="section" width is inside your class="container" and is in
this case 80%, thus this width is based on it's parent width.
So your class="container" is now seen as 100% and your class="section" is
80% of your class="container".
希望这能有所帮助。您至少应该指定一种语言。