gpt4 book ai didi

html - Bootstrap : Textarea height shrinked when I apply Bootstrap style to it

转载 作者:搜寻专家 更新时间:2023-10-31 22:42:58 25 4
gpt4 key购买 nike

我有一个文本区域,其高度属性在 CSS 中设置为 100%。它看起来像这样: original height

当我应用 Bootstrap 样式(向其添加“form-control”类)时,我看起来像这样: After I apply 'form-control' class

检查元素后。我发现 Bootstrap 将其高度值覆盖为“自动”。 CSS 看起来像这样:

textarea.form-control{
height: auto;
}

但即使我将上面代码中的高度更改为

textarea.form-control {
height:100%
}

它仍然看起来像这样: enter image description here

请注意,与原始高度相比,高度仍然缩小了一点。

我怎样才能将它的高度设置为原来的高度(如第一张图片所示)并仍然对其应用 Bootstrap 样式?

最佳答案

试试这个,希望这对你有用。

textarea.form-control {
height:100% !important;
}

关于html - Bootstrap : Textarea height shrinked when I apply Bootstrap style to it,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29455806/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com