Home > Technical > How to center a form in html?

How to center a form in html?

February 28, 2012

Using div tag’s margin attribute we can center a form:

margin: 10px,10px,10px,10px;

(top, right, bottom, left)

 

<html>
<head>
<title>Login Form</title>
<style type=”text/css”>
div {
margin: 250px,450px;
}
</style>
</head>
<body>
<form>
<div>

you context here

</div>

</form>
</body>
</html>

 

 

Advertisements
Categories: Technical
%d bloggers like this: