0
나는 고정 된 사이드 바를 가지고 있습니다. 나는 헤더와 본문 내용을 가지고 있는데, 여기에서 서식이 머리글과 관련하여 중심에 놓이기를 원합니다.양식을 머리글에 맞게 가운데에 배치하는 방법은 무엇입니까?
HTML
<body>
<div id="sideNav">
SideNav
</div>
<div id="mainContent">
<div id="header">
<div>
<h3>
Header
</h3></div>
</div>
<div class="body-content">
<form id="form1">
<h3>
Form
</h3>
<div id="formset">
<table>
<tr>
<td>
<label>Login</label>
</td>
<td>
<input type="text" />
</td>
</tr>
</table>
</div>
</form>
</div>
</div>
</body>
CSS 시도
* {
margin: 0;
padding: 0;
}
body {
position: relative;
}
#sideNav {
width: 150px;
height: 100%;
background-color: #6bc7cc;
position: fixed;
width: 15%;
}
#mainContent {
background-color: Aqua;
height: 100%;
position: absolute;
left: 15%;
right: 0;
}
#header {
width: 100%;
height: 50px;
background-color: #fcb;
}
.body-content {
margin: 45px;
}
#formset {
width: 500px;
margin: 0 auto;
}
https://jsfiddle.net/y7qht3q4/ – vel