bootstrap使输入像文本链接一样

时间:2022-08-23 23:02:12

If you take a look at this fiddle you'll see C is way to the right even though for the most part it looks like the rest of the buttons. On my site it isn't as exaggerated but I do see a space (or two) and it bothers me. How do I set it so the second C looks looks like the one on the first row?

如果你看一下这个小提琴你会看到C是向右的方向,即使在大多数情况下它看起来像其他按钮。在我的网站上它并没有夸张,但我确实看到一个空间(或两个),它困扰我。如何设置它以使第二个C看起来像第一行中的那个?

<a href="/" class="btn btn-lg">A</a>
<a href="/" class="btn btn-lg">B</a>
<a href="/" class="btn btn-lg">C</a>
<br>
<a href="/" class="btn btn-lg">A</a>
<a href="/" class="btn btn-lg">B</a>
<input class="btn btn-lg btn-link" value="C">

2 个解决方案

#1


2  

add this to your CSS

将此添加到您的CSS

.btn {
  width: 50px;
}

https://jsfiddle.net/4zhvb402/

or change this

或改变这一点

.btn {
  text-align:left;
}

https://jsfiddle.net/tgesvue7/

#2


0  

It is an text input element, you should set it's size:

它是一个文本输入元素,你应该设置它的大小:

size="1"

wich makes the size 1 character.

这个大小为1个字符。

Furthermore every browser renders it differently

此外,每个浏览器都以不同方式呈现

#1


2  

add this to your CSS

将此添加到您的CSS

.btn {
  width: 50px;
}

https://jsfiddle.net/4zhvb402/

or change this

或改变这一点

.btn {
  text-align:left;
}

https://jsfiddle.net/tgesvue7/

#2


0  

It is an text input element, you should set it's size:

它是一个文本输入元素,你应该设置它的大小:

size="1"

wich makes the size 1 character.

这个大小为1个字符。

Furthermore every browser renders it differently

此外,每个浏览器都以不同方式呈现