引导:将输入与按钮对齐(bootstrap: align input with button)
为什么按钮和输入在引导中没有对齐? 我试过一些简单的东西:
<input type="text"/><button class="btn">button</button>
该按钮比chrome / firefox中的输入约低5像素。
Why don't buttons and inputs align well in bootstrap? I tried something simple like:
<input type="text"/><button class="btn">button</button>
The button is about 5px lower than the input in chrome/firefox.
原文:https://stackoverflow.com/questions/10615872
更新时间:2024-02-17 21:02
最满意答案
我没有看到任何内置的序列操作函数解决这个问题,尽管一个简单的循环可以很好地构建结果:
user> (loop [coll-1 (set coll-1) coll-2 coll-2 result []] (if-let [[f & r] coll-2] (if (coll-1 f) (recur (disj coll-1 f) r result) (recur coll-1 r (conj result f))) result)) [8 8]
I don't see any of the built in sequence manipulation functions quite solving this, though a straitforward loop can build the result nicely:
user> (loop [coll-1 (set coll-1) coll-2 coll-2 result []] (if-let [[f & r] coll-2] (if (coll-1 f) (recur (disj coll-1 f) r result) (recur coll-1 r (conj result f))) result)) [8 8]
相关问答
更多-
目前google-truth没有任何内置命题来验证Collection包含来自候选Collection中的至少N个元素。 您可以通过查看IterableSubject中的可用方法来确定Collection的命题的内置词汇表。 由于没有内置命题,因此在google-truth执行断言有两个主要选项: 计算您自己的匹配项的数量并用isAtLeast 通过为SubjectFactory提供自定义的SubjectFactory来创建您自己的匹配-N命题 创建你自己的命题是更多的工作,但是让你的测试更具可读性,并在测 ...
-
还有流消息: 'foobar' readStream next: 3. 'foobar' readStream next: 10. 在Squeak / Pharo使用next: ,它会自动截断,如果没有请求的元素可用。 在其他方言如大众和海豚使用更明确nextAvailable:以避免错误。 There are also the stream messages: 'foobar' readStream next: 3. 'foobar' readStream next: 10. In Squeak/Ph ...
-
我没有看到任何内置的序列操作函数解决这个问题,尽管一个简单的循环可以很好地构建结果: user> (loop [coll-1 (set coll-1) coll-2 coll-2 result []] (if-let [[f & r] coll-2] (if (coll-1 f) (recur (disj coll-1 f) r result) (recur coll-1 r (conj result f))) ...
-
纯LINQ和最简单的解决方案如下所示。 static class LinqExtensions { public static IEnumerable
> Split (this IEnumerable list, int parts) { int i = 0; var splits = from item in list group item by i++ % parts int ... -
collection.Skip(Math.Max(0, collection.Count() - N)); 这种方法保留了项目顺序,而不依赖于任何排序,并且在多个LINQ提供商之间具有广泛的兼容性。 重要的是要注意不要使用负数调用“ Skip 。 一些提供者,例如实体框架,当出现负参数时,会产生一个ArgumentException。 对Math.Max的呼吁避免了这一点。 下面的类具有扩展方法的所有要点,它们是:静态类,静态方法和使用this关键字。 public static class MiscEx ...
-
你只需要在xmlValue()调用中使用trim = TRUE参数。 > xpathSApply(doc, "//div[@class='info']//h3", xmlValue, trim = TRUE) #[1] "Baltimore" "Cambridge" "Easton" #[4] "Frederick" "Rockville" "Towson" #[7] "Tysons Corner" "Washington" You jus ...
-
如何使用扩展方法使集合成为“n”元素?(How to make a collection be “n” elements long using extension methods?)[2022-07-06]
快速单行(应该算作“没有扩展方法可行”): public static IEnumerableExtend ( this IEnumerable source, int n) { return source.Concat(Enumerable.Repeat(default(TItem), n)) .Take(n); } 由于Repeat采用显式计数,因此传入n给出了合理的上 ... -
不,JPA不会向您返回与数据库实际不符的实体。 如果一个QuestionSet在数据库中有4个问题,QuestionSet实体将有4个问题。 如果您只想要一些问题,请选择您感兴趣的问题,然后导航到他们的问题集。 或者执行以下查询,它将返回匹配的问题集和匹配的问题: SELECT s, q FROM QuestionSet s JOIN s.questions q WHERE ... No. JPA won't return you entities that don't match the realit ...
-
var matching = names.Where(name => !files.Any(file => file.ToLower().Contains(name.ToLower()))); 在这里工作演示 var matching = names.Where(name => !files.Any(file => file.ToLower().Contains(name.ToLower()))); Working demo here
-
从一个集合中取n个元素(Take n elements from a collection)[2022-03-22]
修复! ..感谢所有的评论。 这个工作版本建立在patrick dw的方法之上。 希望这可以帮助.. var images = jQuery('.image'); for(i = 0; i < images.length / 9; i++) { jQuery('', { id: 'conainter_' + i, html: images.slice(i*9, i*9+9) }).appendTo('body'); } 尽管我最初的回答只是提示;) FIX ! .. than ...