HTML5: how to load an element from left to right side menu

Hy everyone, I have a very simple question: I created a menu on the left with javascript and CSS and I just want when I click on the menu on the left the content will load on the right. Therefore my html structure needs to be organized in two parts, left and right parts. So basically I want to know the best way in HTML5 to do this Thanks in advance


source to share

1 answer

You can use a div to split your page in two; something like:

#container {
    width: 1000px;
#left {
    width: 300px;
    float: left;
#right {
    right: 700px;
    float: right;

<div id="container">
    <div id="left"></div>
    <div id="right"></div>


you have several options for loading content on the right side. You can load the correct content with Ajax, but depending on how big and complex your site is, it can be a big problem. You can simply refresh the entire page, but you will need to make sure your menu stays in sync. You can also put a lot of divs to the right and just display the correct one when they click on the menu.



All Articles