前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >flex布局 div盒子居中

flex布局 div盒子居中

作者头像
kirin
发布2020-07-27 16:35:44
1.2K0
发布2020-07-27 16:35:44
举报
文章被收录于专栏:Kirin博客Kirin博客Kirin博客
直接上代码吧
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>邮箱验证测试</title>
    <style type="text/css">

        *{
            padding: 0;
            margin: 0;
        }
        body,html{
            width: 100%;
            height:100%;
        }
        .top{
            display: flex;
            height: 100%;
            width: 100%;
            justify-content: center;
            align-items: center;

        }
        .cen{
            width: 250px;
            height: 250px;
            background: rgba(110,150,150,0.2);
             border-radius: 10px;
        }
        input {
            border-radius: 5px;
        }
    </style>
</head>
<body>
# 这里是外层div,开启flex 布局
<div class="top">
# 这里是内层div,接收top flex 弹性盒子设置属性。
    <div class="cen" >
<form method="post" action="">
       用户名:<input type="text" name="username"><br>
    密码:<input type="text" name="password"><br>
    验证邮箱:<input type="text" name="mall"><br>

{#    内容 :<input type="text" name="text"><br>#}
    <input type="submit" value="验证">

</form>
        <hr>
        <div >
        <form method="get" action="/sigin">
            输入激活码:<input type="text" name="code">
            <input type="submit" value="提交">

        </form>
    </div>


         <hr>
        <div >
        <form method="get" action="/deng">
            账号:<input type="text" name="username"><br>
            密码:<input type="text" name="password"><br>
            <input type="submit" value="提交">

        </form>
    </div>


        </div>


</div>


</body>
</html>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-07-24 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档