以下是使用 Bootstrap 样式重写的表单代码:

<form action="repair!publishsave" method="post" id="myform">
    <div class="form-group">
        <label for="note-title">标题:</label>
        <input type="text" id="note-title" class="form-control" name="title" required/>
    </div>
    <div class="form-group">
        <label for="search-goods-type">物品种类:</label>
        <select name="cid" id="search-goods-type" class="form-control" required>
            <option value="6" selected="selected">耗材</option>
            <option value="7">维修技能</option>
            <option value="8">维修工具(出售)</option>
            <option value="9">维修工具</option>
        </select>
    </div>
    <div class="form-group">
        <label for="note-info-goods">物品、技能名称:</label>
        <input type="text" style="width:160px;" id="note-info-goods" name="name" class="form-control" required/>
    </div>
    <div class="form-group">
        <label for="note-info-address">地点:</label>
        <input type="text" class="form-control" id="note-info-address" name="address" required/>
    </div>
    <div class="form-group">
        <label for="note-contact-phone">您的手机:</label>
        <input type="text" style="width:85px;" id="note-contact-phone" name="mobile" placeholder="请填写手机号码" class="form-control" required/>
    </div>
    <div class="form-group">
        <label for="note-contact-qq">您的QQ:</label>
        <input type="text" id="note-contact-qq" name="qq" placeholder="qq、手机请至少填写一个" class="form-control"/>
    </div>
    <input type='hidden' id='type' name='type' value='find'/>
    <div class="form-group">
        <label for="note-content">详情描述:</label>
        <textarea id="note-content" name="info" class="form-control"></textarea>
    </div>
    <div class="form-group">
        <label for="note-info-extra">备注:</label>
        <input type="text" id="note-info-extra" name="remark" class="form-control">
    </div>
    <div class="text-right">
        <button type="submit" class="btn btn-primary" id="post-submitBotton">发布信息</button>
    </div>
</form>

注意:在上述代码中,使用了 Bootstrap 的 form-group 类来包裹每个表单元素,并使用 form-control 类来设置表单元素的样式。另外,required 属性用于设置必填项。

Bootstrap 表单样式重写示例 - 使用 Bootstrap 类轻松美化表单

原文地址: https://www.cveoy.top/t/topic/fz1E 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录