利用margin属性将一个div水平居中

建站知识 2021-07-03 08:15www.168986.cn长沙网站建设

复制代码
代码如下:

<%@ page language="java" import="java.util." pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'margin.jsp' starting page</title>
<style>
div{
height:100px;
width:1002px;
background:yellow;
margin:0px auto;
}
</style>
</head>
<body>
<div></div>
</body>
</html>

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by