Select2 4.0.0 - 更改输入框高度 [英] Select2 4.0.0 - change inputbox height

查看:3437
本文介绍了Select2 4.0.0 - 更改输入框高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我使用select2,空框只是一行高。
当添加输入时,框会相应地扩展,但总是只是所需的精确量。

whenever I use select2, the empty box is just one line high. When input is added, the box expands accordingly, but always just the exact amount needed.

如何更改它,使我的输入框至少为100px高,即使空吗?在某些情况下,我期望框填充时为100像素或更高,所以如果框首先只有16像素高,它在我的布局看起来真的很蠢。

How can I change it so my input box is at least 100px high, even if empty? In some cases, I expect the box to be 100px or even higher when filled, so it looks really dumb in my layout, if the box is just 16px high in the first place.

我应用select2()的HTML元素是一个Select元素, =多个(我最终需要多个输入。)

The HTML element to which I'm applying select2() is a Select element with "multiple=multiple" (I need multiple inputs eventually.)

我google了很多,也在这个论坛搜索,但没有什么工作到目前为止。
我试图在我的自定义css文件中包括这样的东西:

I googled a lot, and also searched in this forum, but nothing worked so far. I tried including something like this in my custom css file:

.select2-container .select2-choice {
min-height:100px !important;
}

但它没有改变任何东西。也许这些tipps是旧版本的select2?我使用的是4.0.0。

But it didnt't change anything. Maybe those tipps are for older versions of select2? I'm using 4.0.0.

如何放大盒子?

我将它添加到我的css。这是所有关于获取css选择器正确(这似乎已经改变,最近)。我通过检查我的HTML输出提取他们的名字。

I added this to my css. It's all about getting the css selectors right (which indeed seem to have changed, recently). I extracted their names by inspecting my HTML output.

.select2-container .select2-selection--multiple{
    min-height:100px;
    padding-bottom: 50px;
}


推荐答案

.select2-selection.select2-selection--multiple {
    min-height: 100px;
}

示例页

这篇关于Select2 4.0.0 - 更改输入框高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆