How to set html body into two parts with CSS effect. In the first part we call it the menu features section, the second part is the post content section. In the previous post I wrote to create a data input form, we consider the data input form as post content.
Read also: How to Make a Simple HTML Data Input Registration Form Display
Make the nav menu (menu feature) on the body which we will put on the left. Here’s the Html Tag
-
Options Menu
- User Data Input Form
- User Data
- Information
We put the html code above in the container class, as below
Next, we write the right content post code next to the menu feature, here’s an example of the code:
Data Input Form
We put the code just below the code. After we finish writing the code above sequentially we can give a touch of css so that it looks the way we want. First we will provide the css code for the container class
.container {
margin-bottom: 5px;
}
As usual, we will put the css code inside the tag …. the css code above serves to provide a distance between the container class and the footer with a distance of 5px. Next we will provide a css function in the menu features section (nav menu), here is the css code
float: left;
max-width: 160px;
margins: 0;
padding: 1em;
background-color: #cdccfe;
height: 458px;
}
nav ul {
list-style-type: none;
padding: 0;
background-color: #cdccfe;
}
nav ul li {
colors: #000;
float: initial;
}
nav ul li h2 {
margins: 0px;
}
nav ul li a:hover {
background-color: #fff;
border-radius: 10px;
}
nav ul a {
text-decoration: none;
colors: #000;
text-align: left;
padding: 5px;
}
We give the function float left to give the menu position to the left. function list-style-type: none, serves to remove the round symbol in the list function.
![](https://posgaruda.com/wp-content/uploads/2022/10/How-to-Set-HTML-Body-Into-Two-Parts-with-CSS.jpg)
.post-content {
margin-left: 170px;
border-left: 1px solid gray;
overflow: hidden;
}
If we have written all the code above correctly it will display a page like below
![](https://posgaruda.com/wp-content/uploads/2022/10/1664847605_857_How-to-Set-HTML-Body-Into-Two-Parts-with-CSS.jpg)
Thus my writing on how to set the body html into two simple parts. Hopefully useful for all friends. If my review is not clear, we can discuss it in the comments. Thank you