Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在面板中并排设置控件_C#_Html_Css_Asp.net - Fatal编程技术网

C# 如何在面板中并排设置控件

C# 如何在面板中并排设置控件,c#,html,css,asp.net,C#,Html,Css,Asp.net,我有这样的想法: 但我需要像这样设置彼此相邻的控件: my Panel.aspx <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:Panel ID="pnlProducts" runat="server"></asp:Panel> <div style="clear: both"></div> &l

我有这样的想法:

但我需要像这样设置彼此相邻的控件:

my Panel.aspx

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" 
Runat="Server">
<asp:Panel ID="pnlProducts" runat="server"></asp:Panel>
<div style="clear: both"></div>
</asp:Content>

我不知道我必须在哪里使用float:Left或类似的东西如何在面板中并排设置控件

您应该使用Flex box,它非常简单

关于你的父母:

display: flex;
flex-wrap: wrap;
关于孩子:

flex: 1 1 20%;

float:left
在这里完全没有必要。元素默认为
display:block
,这“鼓励”它们占据尽可能多的水平空间。要解决此问题,请为每个
productPanel
指定
display:inline
display:table cell
属性,但“flied wrap”不是一个已知的CSS属性名。@Tprogramer1它是
flex wrap
#contentplaceholder 1\u pnlProducts div{…….display:flex;flex wrap:wrap;}.productName{flex:120%;}.productPrice{flex:120%;}.productImage{flex:120%;}它仍然不起作用。@t程序员1您在使用IE7吗?您的孩子有没有任何利润?
display: flex;
flex-wrap: wrap;
flex: 1 1 20%;