首页 > 解决方案 > 一个盒子里的html表单?

问题描述

我想把一个表格放在一个盒子里,或者在表格周围有一个边框,但我卡住了。背景必须是白色的,我想也许一个透明的选项是可以的。那里的任何专家都有一些简单的想法如何解决它?附上一些代码。提琴手

我想要完成的

<body>
<div id="border"></div>
<div id="text">Auf dem tisch</div>
</body>

body {background: white;}

#border {
        border: 2px solid black;
        position: absolute;
        z-index: 1;
        width: 100px;
        height: 80px;
        margin-center: 0;
        padding: 15px;
        border-radius: 1px;
        background: navy;
        opacity: 0.2;
    }

#text   {
        margin-center: 0;
        z-index: 2;
        color: black;
        font-weight: bold;
    }

标签: htmlformstextboxborder

解决方案


    <div class="box">
<form>
..
..
</form>
</div>

// css style to make border in center of the form

.box{
margin:0 auto; 
width:600px //you can set it in %.
padding:20px;
background:#f9f9f9;
border:2px solid #333;
}

推荐阅读