【问题标题】:Color border input in red (twig)红色边框输入(树枝)
【发布时间】:2019-03-17 16:53:17
【问题描述】:

大家好,我有个小问题,我不知道为什么我的输入不是红色的……这是我的代码(应该很简单,但我看不出我的代码哪里出错了)

我的 html 代码(树枝):

{{ form_widget(form.value, {'attr': {'class': 'error_input'}}) }}

我的CSS:

.error_input{
    border : 1px solid red;
}

ps:我正在使用 Symfony 3.4

【问题讨论】:

  • 您的error_input 可能会被其他内容覆盖。首先检查这个。如果您对此没有控制权,您可以这样做:border-color: 1px solid red !important; 尽管它主要用作最后一个选项。不要滥用!important 标签。

标签: php html css symfony twig


【解决方案1】:

好的,找到了...

.error_input{ border : 1px solid red !important; }

但是为什么没有 !important ... 就不行呢?

【讨论】:

  • 你的 CSS 被其他东西覆盖了。这可能是使用相同类名的库/文件。
  • 但是当我用随机名称命名它时:“error_input12345azerty”仍然无法使用!important
猜你喜欢
  • 2021-08-28
  • 2015-05-31
  • 2011-04-18
  • 2017-10-08
  • 2021-12-23
  • 1970-01-01
  • 2020-11-06
  • 2014-05-03
  • 1970-01-01
相关资源
最近更新 更多