首页 \ 问答 \ Bootstrap按钮没有与输入字段对齐(Bootstrap button not lining up with input field)

Bootstrap按钮没有与输入字段对齐(Bootstrap button not lining up with input field)

我无法通过glyphicon-search按钮在引导程序中排队。 这不是一个独特的问题,我发现这个问题提出了类似的问题,除了接受和庆祝的答案对我不起作用。 就像答案一样,我有一个div输入组包装器应该排成一行,但它不起作用,你可以在我的jsfiddle中看到:

http://jsfiddle.net/pk84s94t/

<div class="input-group">
    <span class="input-group-btn">
        <button class="btn btn-default glyphicon glyphicon-search input-sm" type="submit"></button>
    </span>
    <input type="text" class="form-control input-sm">
</div>

I'm having trouble getting a glyphicon-search button to line up in bootstrap. This is not a unique problem, I found this question that asks a similar thing, except the accepted and celebrated answer isn't working for me. Just like the answer, I have a div input group wrapper that should line up the field, but it isn't working, as you can see in my jsfiddle:

http://jsfiddle.net/pk84s94t/

<div class="input-group">
    <span class="input-group-btn">
        <button class="btn btn-default glyphicon glyphicon-search input-sm" type="submit"></button>
    </span>
    <input type="text" class="form-control input-sm">
</div>

原文:https://stackoverflow.com/questions/36700643
更新时间:2022-11-17 07:11

最满意答案

\是正则表达式中的转义字符,可用于转义自身,这意味着您可以编写\\n来匹配文本\n

使用模式\\r\\n并替换为\r\n


\ is an escape character in regex and can be used to escape itself, meaning that you can write \\n to match the text \n.

Use the pattern \\r\\n and replace with \r\n.

相关问答

更多
  • 这会做什么? [^\r]\n 基本上它匹配一个'\ n',后面跟着一个不是'\ r'的字符。 如果您希望它检测以单个'\ n'开头的行,请尝试 ([^\r]|$)\n 它说它应该匹配一个'\ n',但只有那些是第一个字符的字符或那些不是以'\ r'开头的字符 可能有特殊情况需要检查,因为你正在搞乱线条的定义,'$'可能不太好。 但我认为你应该明白。 编辑:信用@Kibbee使用预见s显然更好,因为它不会捕获匹配的前面的字符,并应该帮助任何边缘案例。 所以这里有一个更好的正则表达式+代码变成: myStr ...
  • \是正则表达式中的转义字符,可用于转义自身,这意味着您可以编写\\n来匹配文本\n 。 使用模式\\r\\n并替换为\r\n 。 \ is an escape character in regex and can be used to escape itself, meaning that you can write \\n to match the text \n. Use the pattern \\r\\n and replace with \r\n.
  • 您的正则表达式语法不正确,您将它包含在级联字符类中,并且您尝试在类中使用捕获组,这会导致模式在到达结束时失败) 简而言之,您的正则表达式当前定义了一组字符( 不是您想要的 )然后失败。 [[^([A-Z] # any character of: '[', '^', '(', '[', 'A' to 'Z' 要解决此问题,您需要删除已放置的字符类和捕获组,确保在正则表达式模式中双重转义\w ,然后它应该适合您。 我在我的控制台上测试了它,它工作正常。 > df[,-1] <- str_replace_a ...
  • 已经有nl2br()函数替换新行符之前插入的
    标签: 示例( 键盘 ): '; echo nl2br($desc2); ?> 但是如果它仍然不工作,请确保文本$desciption是双引号。 这是因为单引号不会扩展转义序列,例如\n与双引号字符串相 ...
  • 编辑要将多个连续换行符(\n)替换为____ ,应执行以下操作: >>> import re >>> i = "(2 months)\n\nML" >>> re.sub(r'(\n+)(?=[A-Z])', r'____', i) '(2 months)____ML' (?=[AZ])是断言“换行符后跟大写字母”。 REGEX DEMO 。 EDIT To replace multiple continuous newline characters (\n) to ____, this should d ...
  • 这是br元素被剥离的地方: var $col = $(col), text = $col.text(); 一种解决方案是用标记替换它们,然后用\r\n替换标记: var $col, text; $col = $(col).clone(); $col.find("br").replaceWith("
    {{MARKER}}
    "); text = $col.text().replace(/{{MARKER}}/g, "\r\n"); 那 克隆元素,以便我们可以在不更改文档的情况下更 ...
  • 您的替换不是全局替换 - 它们只替换字符串中模式的第一个实例。 要进行全局替换,请在最后一个斜杠后加上ag,如下所示: $description =~ s/\r//g; $description =~ s/\n//g; 您还可以使用字符集将这两个替换组合成单个替换: $description =~ s/[\n\r]//g; Your substitutions are not global substitutions - they replace only the first instance of t ...
  • 这将用一些东西替换一个或多个换行符,不一定用一个换行符 - 这是由你没有显示的regex_newline.Replace(...)调用决定的。 所以基本上,答案是 Regex regex_newline = new Regex("(\r\n|\r|\n)"); // remove the '+' // : regex_newline.replace(somestring, "X"); That will replace one or more newlines with something, n ...
  • 要匹配字符,可以将字符放在括号内,如[.] 。 要不匹配,可以使用[^.]等插入符启动字符列表。 这将有效地匹配任何不是a的角色. 。 对于您的特定情况,您希望匹配没有的\r\n . 在它面前。 结合以上内容,您可以使用: [^.]\r\n 要替换它,您需要“捕获”非一段时间的角色以使其保持替换状态。 您可以通过将其包装在括号中来捕获它,例如([^.]) 。 使用Regex.Replace() ,它将是这样的: yourString = Regex.Replace(yourString, @"([^.]) ...
  • 你需要使用 \r(?!\n) 也就是说,从\r(?!^\n)表达式中删除字符串/行修饰符的^ start。 \r将匹配回车符,如果在其右侧有一个LF,则(?!\n)将使匹配失败。 一个C#演示: var s = "Line1\rLine2\r\nLine3"; var res = Regex.Replace(s, "\r(?!\n)", "\r\n"); Console.WriteLine(res.Replace("\r","CR").Replace("\n","LF\n")); // => Line1C ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。