如何将引导程序 3 表单控制输入与隐藏的 true 结合起来 [英] How to combine bootstrap 3 form-control input with hidden true

查看:27
本文介绍了如何将引导程序 3 表单控制输入与隐藏的 true 结合起来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 bootstrap 3 并且有一个小问题.最好用代码来解释:

I am using bootstrap 3 and have a little issue. It is better explained with the code:

<input class="form-control" type="text" name="name" id="id" hidden="true"/>

我希望这个输入是隐藏的,但看起来表单控件的 css 显示属性覆盖了隐藏的.

I expect this input to be hidden, but looks like form-control css display property overrides hidden one.

@media (min-width: 768px)
.form-inline .form-control {
    display: inline-block;
    width: auto;
    vertical-align: middle;
}
[hidden], template {
    display: none;
}

我确实在 chrome dev-tools 中看到 hidden 的显示有删除线.

I do see in chrome dev-tools that hidden's display has strikethrough.

我知道引导程序有隐藏"类并且它可以工作,但我希望隐藏属性也可以工作.不是bug吗?

I know that bootstrap has "hidden" class and it works, but I would expect that hidden attribute would work too. Isn't it a bug?

谢谢

推荐答案

作为您想要的答案,您可以使用 display: none;visibility: hidden;代码>

As an answer to what you want, you can use either display: none; or visibility: hidden;

检查 http://www.w3schools.com/Css/css_display_visibility.asp或使用 opacity: 0; 并且您可以使用 CSS 或 JavaScript 取消隐藏.

Check http://www.w3schools.com/Css/css_display_visibility.asp or use opacity: 0; and you can unhide with either CSS or JavaScript.

这篇关于如何将引导程序 3 表单控制输入与隐藏的 true 结合起来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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