<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0px;
padding: 0px;
}
#tobar{
width: 100%;
height: 40px;
background-color: #3d95d5;
display: flex;
justify-content: space-between;
align-items: center;
}
#jlbhandtxm{
width: 100%;
height: 40px;
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 auto;
}
#querybtn{
width: 100%;
height: 50px;
margin-left: 20px;
margin-right: 20px;
margin-top: 20px;
background-color: #3d95d5;
color:white;
border-radius: 5px;
border-color: #38c !important;
color: #fff !important;
text-shadow: 0 1px 0 #059 !important;
}
#zsxxtable{
width: 100%;
margin-top: 20px;
padding: 0;
border: 1px solid #ddd;
border-collapse: collapse;
border-spacing: 0px;
padding-left: 20px;
padding-right: 20px;
}
#zsxxtable tr{
height: 35px;
}
.lefttd{
width: 40%;
background-color: #9fd4f5;
text-align: center;
border: 1px solid #ddd;
font-family: 微软雅黑;
font-size: 15px;
}
.righttd{
width: 60%;
border: 1px solid #ddd;
padding-left: 10px;
}
#querybh{
height: 40px;
border: 1px solid #ccc;
border-radius: 2px;
padding:0px;
margin-top:20px;
margin-bottom: 20px;
margin-left: 20px;
margin-right: 20px;
width: 100%;
}
#querybh:focus{
/* border: 3px solid red; */
/* outline: 3px solid red; */
outline: 0; border: 1px solid red;
}
#querybh:active{
/* border: 3px solid red; */
/* outline: 3px solid red; */
outline: 0; border: 1px solid red;/* textbox focus的时候有样式 */
}
.align-center{
margin:0 auto; /* 居中 这个是必须的,,其它的属性非必须 */
width:500px; /* 给个宽度 顶到浏览器的两边就看不出居中效果了 */
background:red; /* 背景色 */
text-align:center; /* 文字等内容居中 */
}
.my-center{
width: 300px;
margin: 0 auto;
}
#tobar2{
display: flex;
justify-content: space-evenly;
width: 100%;
height: 40px;
background-color: #3d95d5;
display: flex;
}
</style>
</head>
<body>
<div id="tobar" >
<!-- 使用just-content:space-between 左中右,中间居中对齐了,使用flex,但是里面的div需要是3个,否则中间那个不能居中对齐 -->
<div style="margin-left:10px;color:white;">返回</div>
<div style="width: 100px;color:white;">计量证书查询</div>
<div></div>
</div>
<div id="tobar2" >
<div style="margin-left:10px;color:white;">返回aaa</div>
<div style="width: 100px;color:white;">计量证书查询</div>
</div>
<div id="jlbhandtxm">
<div></div>
<div>请输入计量证书编号或证书条码</div>
<div></div>
</div>
<div style="background-color:#ccc ;width:100%;height:1px;"></div>
<div style="width: 100%;display: flex;">
<!-- 这个需要flex否者,否则只能有margin-left,而右边marg-right展示不出来 -->
<input id="querybh" type="text" >
</div>
<div style="background-color:#ccc ;width:100%;height:1px;"></div>
<div style="width: 100%;display: flex;">
<input id="querybtn" type="button" value="查询" >
</div>
<!-- <div style="margin:0 auto;background-color:red; text-align: center;"> -->
<div >
<div style="width: 200px;height:50px;background-color:#ccc;margin: 0 auto; text-align: center;line-height: 50px;">
dfdfdf
<!-- 这个是div在中间,居中对齐 ,line-height=height是垂直居中对齐-->
</div>
<span style="width: 150px;background-color: blue; margin: 0 auto;">
<!-- 这个span没有做到水平居中对齐,如果想水平居中对齐,需要把我注掉的div打开 -->
水平居中对齐
</span>
</div>
<div class="align-center">居中div演示效果</div>
<table id="zsxxtable">
<tr>
<td class="lefttd">证书编号</td>
<td class="righttd"></td>
</tr>
<tr>
<td class="lefttd">送检单位</td>
<td class="righttd"></td>
</tr>
<tr>
<td class="lefttd">计量器具名称</td>
<td class="righttd">数字兆欧表</td>
</tr>
<tr>
<td class="lefttd">型号/规格</td>
<td class="righttd"></td>
</tr>
<tr>
<td class="lefttd">出厂编号</td>
<td class="righttd"></td>
</tr>
<tr>
<td class="lefttd">制造单位</td>
<td class="righttd"></td>
</tr>
<tr>
<td class="lefttd">批准人</td>
<td class="righttd"></td>
</tr>
<tr>
<td class="lefttd">核验员</td>
<td class="righttd"></td>
</tr>
<tr>
<td class="lefttd">检定员</td>
<td class="righttd"></td>
</tr>
<tr>
<td class="lefttd">管理编号</td>
<td class="righttd">/</td>
</tr>
</table>
</body>
</html>