Foundation 输入框尺寸

我们可以使用网格的列来设置输入框的大小,如.large-6,.medium-6

更多网格系统知识,可以访问我们的 Foundation 网格系统

<form> 
  <div class="row">
    <div class="large-10 medium-7 columns">
       <label>large-10 medium-7 (100% on small)
      <input type="text" placeholder="姓"></label>
    </div>
  </div>
  <div class="row">
    <div class="small-5 columns">
      <label>small-5 <input type="text" placeholder="名"></label>
    </div>
  </div>
  <div class="row">
    <div class="medium-3 columns">
      <label>medium-3 (100% on small)<input type="text" placeholder="搜索"></label>
    </div>
  </div>
</form>

运行范例 »

相等大小列

<form> 
  <div class="row">
    <div class="medium-4 columns">
      <label>medium-4 (100% on small, stacked)<input type="text" placeholder="Name"></label>
    </div>
    <div class="medium-4 columns">
      <label>medium-4 (100% on small, stacked) <input type="text" placeholder="Name"></label>
    </div>
    <div class="medium-4 columns">
      <label>medium-4 (100% on small, stacked) <input type="text" placeholder="Name"></label>
    </div>
  </div>
</form>

运行范例 »

内联 <label>

如果想要 <label> 的内容显示在左边,可以将 <label> 放在输入框左边的不同的列上,并使用.inline类来设置垂直居中

<form> 
  <div class="row">
    <div class="small-8">
      <div class="row">
        <div class="small-3 columns">
          <label for="name" class="inline right">Name</label>
        </div>
        <div class="small-9 columns">
          <input type="text" id="name" placeholder="First Name..">
        </div>
      </div>
    </div>
  </div>
</form>

运行范例 »

前置和后置元素

可以在 <div class="row collapse"> 中添加前置和后置元素

元素为 <elemen class="postfix"><element class="prefix">

可以使用网格系统来设置前置和后置标签的大小

<form>
  <div class="row">
    <div class="large-6 columns">
      <div class="row collapse prefix-radius">
        <div class="small-3 columns">
          <span class="prefix">Prefix</span>
        </div>
        <div class="small-9 columns">
          <input type="text" placeholder="Value">
        </div>
      </div>
    </div>
    <div class="large-6 columns">
      <div class="row collapse postfix-radius">
        <div class="small-9 columns">
          <input type="text" placeholder="Value">
        </div>
        <div class="small-3 columns">
          <span class="postfix">Postfix</span>
        </div>
      </div>
    </div>
  </div>
</form>

运行范例 »

前置和后置标签按钮

<a> 元素添加 .button 类来设置前置和后置按钮

<a href="#" class="postfix button">搜索</a>

运行范例 »

前置和后置标签圆角按钮

<form>
  <div class="row">
    <div class="large-6 columns">
      <div class="row collapse prefix-radius">
        <div class="small-3 columns">
          <span class="prefix">Prefix</span>
        </div>
        <div class="small-9 columns">
          <input type="text" placeholder="Value">
        </div>
      </div>
    </div>    
    <div class="large-6 columns">
      <div class="row collapse postfix-radius">
        <div class="small-9 columns">
          <input type="text" placeholder="Value">
        </div>
        <div class="small-3 columns">
          <span class="postfix">Postfix</span>
        </div>
      </div>
    </div>  
  </div>
  <div class="row">
    <div class="large-6 columns">
      <div class="row collapse prefix-round">
        <div class="small-3 columns">
          <a href="#" class="button prefix">搜素</a>
        </div>
        <div class="small-9 columns">
          <input type="text" placeholder="Value">
        </div>
      </div>
    </div>
    <div class="large-6 columns">
      <div class="row collapse postfix-round">
        <div class="small-9 columns">
          <input type="text" placeholder="Value">
        </div>
        <div class="small-3 columns">
          <a href="#" class="button postfix">Go</a>
        </div>
      </div>
    </div>  
  </div>
</form>

运行范例 »

关于   |   FAQ   |   我们的愿景   |   广告投放   |  博客

  简单教程,简单编程 - IT 入门首选站

Copyright © 2013-2022 简单教程 twle.cn All Rights Reserved.