【问题标题】:How do I place my search field to my desired position如何将我的搜索字段放在我想要的位置
【发布时间】:2019-08-10 08:14:45
【问题描述】:

我想将搜索字段放在我喜欢的位置,我需要它显示在中心,如下图所示我尝试使用 class="right" 和 class="center- align" 两者都不起作用,实际上它不在中心,向左一点。请帮忙!!

base.html

    <ul class="center-align">
      <li>
        <form action="{% url 'loststuffapp:IndexView' %}" method="get">
          <input name="q" type="text" placeholder="Search..." value=" 
           {{request.GET.q}}">
        </form>
      </li>
    </ul>

【问题讨论】:

    标签: django materialize


    【解决方案1】:

    您应该在 CSS 的搜索字段中添加“margin-left”和“padding-left”。

    input {
        margin-left: 50px;
        padding-left: 50px;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-18
      • 2011-01-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多