I have one main div (page) which has another internal div (central). I applied CSS for both the divs. I gave the margin-top attribute for both the divs separately in CSS, but the margin-top of the internal div is being applied to external div also. How can I fix this problem?
CSS:
#page
{
position: relative;
margin: auto;
margin-top: 40px;
margin-left: auto;
background-color: #b3dced;
height: 900px;
width: 900px;
border-radius: 10px;
}
.central
{
position: relative;
margin: auto;
margin-top: 80px;
background-color: blue;
height: 500px;
width: 500px;
border: 2px solid green;
border-radius: 10px;
}
<body>
<div id="page">
<div class="central">
<table>
<tr>
<td>name</td>
<td><input type="text" /></td>
</tr>
<tr>
<td>name</td>
<td><input type="text" /></td>
</tr>
<tr>
<td>name</td>
<td><input type="text" /></td>
</tr>
</table>
</div>
</div>
</body>