2019-04-21
2019-04-21 本文已影响0人
蓝子_23d0
按钮水平居中放在容器中
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>demo</title>
<style>
#content {
background:#ccc;
padding:40px 0;
text-align:center;
}
.bstyle {
display: inline-block;
background-color:red;
color:#fff;
border-radius:4px;
text-decoration: none;
padding:5px 5px;
border: none;
}
</style>
</head>
<body>
<div id = "content">
<button class = "bstyle">按钮1</button>
<button class = "bstyle">按钮2</button>
<button class = "bstyle">按钮3</button>
</div>
</body>
</html>