×

css如何让div中的form表单居中显示?

来源于网络 来源于网络 发表于2020-09-29 00:38:49 浏览14 评论0

抢沙发发表评论

美国200G高防现已上架 性价比之王中王 大宽带 CN2直连 高性能 感受不一般全美到大陆最快线路 誉为【站群王】赠天机盾防CC 限时限购低至5折!立即抢购!

图片说明

如何让框中居中显示,和下面对齐?

<div class="layui-fluid" id="divcss5">
    <div class="layui-row">
        <form class="layui-form" id=form1 method="post" >
            <input type="hidden" id="userid" name="userid" th:value="${session.id2}">

            <div class="layui-form-item" style="text-align: center">
                <label for="lng" class="layui-form-label">
                    <span class="x-red">*</span>经度:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="lng" name="lng" class="layui-input" required="required">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="lat" class="layui-form-label">
                    <span class="x-red">*</span>纬度:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="lat" name="lat" class="layui-input" required="required">
                </div>
            </div>

            <div class="layui-form-item">
                <label for="facilityname" class="layui-form-label">
                    <span class="x-red">*</span>设备名称:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="facilityname" name="facilityname" class="layui-input" required="required">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="mac" class="layui-form-label">
                    <span class="x-red">*</span>设备码:
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="mac" name="mac" class="layui-input" required="required">
                </div>
            </div>


        </form>
        <div class="layui-form-item">
            <button class="layui-btn" lay-filter="add" onclick="huoqu()" lay-submit="">获取经纬度</button>
            <button class="layui-btn" lay-filter="add" onclick="add()" lay-submit="">确定</button>
        </div>
    </div>
</div>
<div class="layui-row" style="display:flex;justify-content:center;">

使用margin,第二个用auto

<div style="width:300px;height:300px;background-color:green;margin:100px auto;">   
</div>

https://zhidao.baidu.com/question/1173873433462364139.html

【版权说明:本篇文章基于互联网CC-BY-NC-SA分享协议;如需转载时请注明出处及相应链接!】

美国免备案服务器

评论一下

访客