没有行的bootstrap列比行填充更多的列(bootstrap columns without rows padded more than columns with rows)
我正在使用自举网格系统来布局模态。
显示商店的模式部分不能有行,因为它只是商店中的foreach商店,所以我不能在它们之间插入行。 这很好,除了它似乎在列不在行内时添加更多填充,这导致我的商店不与上面的内容垂直对齐。 这就是我的意思(商店是纯白色的div):
商店的填充比上面的内容更进一步。 商店没有连续。
一个商店的代码:
<script type="text/html" id="shop-template"> <div class="col-sm-6" style=""> <div style="height: 200px;width:100%; background: #fff;border-radius:15px;padding: 25px;"> <h6 class="medium-text shop-info" data-bind="text: name" > </h6> <h6 class="medium-text shop-info" data-bind="text: suburb" style=""> </h6> <h6 class="medium-text shop-info" data-bind="text: streetNumber" style="display:inline;"> </h6> <h6 class="medium-text shop-info" data-bind="text: street" style="display:inline;"> </h6> <h6 class="medium-text shop-info" data-bind="text: country" > </h6> <h6 class="medium-text shop-info" data-bind="text: postalCode" > </h6> </div> </div> </script>
如何使商店与上面的内容垂直对齐?
I'm using the bootstrap grid system to lay out a modal.
The part of the modal that displays shops cannot have rows, because it is simply a foreach shop in shops, so I can't insert rows in between them. This is fine except that it seems to add more padding when the columns are not inside rows, which causes my shops to not be vertically aligned with the content above. Here is what I mean (the shops are the solid white divs):
The shops are padded further in than the content above them. The shops are not in a row.
code for one shop:
<script type="text/html" id="shop-template"> <div class="col-sm-6" style=""> <div style="height: 200px;width:100%; background: #fff;border-radius:15px;padding: 25px;"> <h6 class="medium-text shop-info" data-bind="text: name" > </h6> <h6 class="medium-text shop-info" data-bind="text: suburb" style=""> </h6> <h6 class="medium-text shop-info" data-bind="text: streetNumber" style="display:inline;"> </h6> <h6 class="medium-text shop-info" data-bind="text: street" style="display:inline;"> </h6> <h6 class="medium-text shop-info" data-bind="text: country" > </h6> <h6 class="medium-text shop-info" data-bind="text: postalCode" > </h6> </div> </div> </script>
How do I make the shops vertically aligned with the content above?
原文:https://stackoverflow.com/questions/37344036
最满意答案
a.[0]
返回:'1'
的第一个字符 。 将字符转换为int
将返回其ASCII码 。 你需要在字符串上调用int
来代替:let x = a.Substring(a.Length - 1) int x
(我在第一行使用了标准的.Net方法; F#标准库也有相同的功能。)
a.[0]
returns the first character ofa
:'1'
. Casting a character toint
returns its ASCII code. You need to callint
on a string instead:let x = a.Substring(a.Length - 1) int x
(I've used standard .Net methods on the first line; the F# standard library also has functions to do the same.)
相关问答
更多-
将int转换为字符串(Converting int to string)[2022-10-06]
如果您使用Linq,它只是一行代码。 public int findWeightByName(string name, Flaske[] kasse) { return kasse.Where(x => x.name == name).Sum(w => w.weight); } Where使用传递的名称提取Flaske序列,Sum对序列进行处理以总结权重 It is just one line of code if you use Linq. public int findWeightByName ... -
将十六进制字符串转换为int(Convert hex string to int)[2022-04-15]
对于int(这是4个字节并签名)来说它太大了。 使用 Long.parseLong("AA0F245C", 16); It's simply too big for an int (which is 4 bytes and signed). Use Long.parseLong("AA0F245C", 16); -
将字符串转换为int(2)(Converting string to int (2))[2024-02-27]
Convert.ToInt32可能仍会抛出错误,例如当它为空时,因此使用: int result=0; Int32.TryParse(Request.Form["ID"].ToString(), out result); 然后在你的代码中: Nav n = navDB.Navs.FirstOrDefault(row => row.ID == result); Convert.ToInt32 may still throw an error, for example when it is empty ... -
教授对zfill的询问是: ip = ip[0].__str__().zfill(3) + ip[1].__str__().zfill(3) + ip[2].__str__().zfill(3) + ip[3].__str__().zfill(3) 但请注意,您的列表已包含字符串,因此您无需再次转换它们,那么您的代码将是: ip = ip[0].zfill(3) + ip[1].zfill(3) + ip[2].zfill(3) + ...
-
a.[0] 返回: '1'的第一个字符 。 将字符转换为int将返回其ASCII码 。 你需要在字符串上调用int来代替: let x = a.Substring(a.Length - 1) int x (我在第一行使用了标准的.Net方法; F#标准库也有相同的功能。) a.[0] returns the first character of a: '1'. Casting a character to int returns its ASCII code. You need to call int o ...
-
尝试使用GetNumericValue而不是Convert.ToInt32()。 文档: http : //msdn.microsoft.com/en-us/library/system.char.getnumericvalue.aspx 另外 - 除非我遗漏了一些东西,否则你可能会简化你的代码: num1 = Char.GetNumericValue(date1[0]); num2 = Char.GetNumericValue(date1[1]); num3 = Char.GetNumericValue( ...
-
我认为你的字符串是UTF16编码的 ,所以每个字符都用16位或2字节编码。 PHP仍然认为它是一个ASCII字符串,读取第一个字节( 2 ),然后读取第二个字节(零字符),然后停在那里。 iconv('UTF-16', 'ASCII', $year)应该有所帮助 编辑我猜测字符串是UTF16,因为它的字符虽然是ASCII,但每个字符占用2个字节。 你的字符串可能是亚洲双字节编码之一,但仍然很可能是Unicode,你可能在Windows上,因为UTF16是Windows的内部编码。 这是一篇关于Unicode ...
-
注释掉这两行,它会起作用: lst.insert(lst.index(d), j2) lst.insert(lst.index(d), j1) 显然,当你循环遍历列表并同时删除,并在开始索引时插入错误。 为避免麻烦,请使用列表的副本: def date(lst, d1, d2): lstC = list(lst) for d,dd in zip(lst, lstC): if int(d[4:]) >= int(d1[4:]) or int(d[4:]) <= int(d ...
-
这里的问题是, p1.push(str1[i] - '0'); 正在尝试从'-'减去'0' ,如果字符串包含负数,因为您总是以i = 0开头。 您需要做的是在循环之前检查字符串是否为负数,然后根据该检查从0或1开始。 你可能有类似的东西 void Soma::StrToInt(char str1[], char str2[]){ int start = 0; if(str1[0] == '-'){ //if is negative negative1 ...
-
std::to_string(xWidth) 。 &几乎无关紧要。 to_string通过值获取int ,所以你的函数如何获取它并不重要:通过value,lvalue ref,rvalue ref, const或non const ... all都可以。 std::to_string(xWidth). The & is pretty much irrelevant. to_string takes the int by value, so how your function takes it doesn't ...