I'm a beginner in CSS and HTML and I'm struggling to make my sidebar move to the side on my website. I have divided my site into three div areas: one for the 'sidebar', one for the 'main content', and one for both called 'content'.
Here is my CSS code...
#content{
padding:10px;
background-color: #eee;
-moz-border-radius: 15px;
border-radius: 15px;
width: 900px ;
margin-left: auto ;
margin-right: auto ;
margin-top: 150px;
}
#mainContent{
float: left;
display: block;
width: 230 px;
margin: 0;
padding: 0 15px;
background:#9c9;
}
#sidebar{
float: right;
display: block;
margin: 0;
padding: 0 10px;
width: 250px;
border-left: 2px solid black;
}
Unfortunately, this setup isn't giving me the desired outcome. The page currently looks like this:
What I actually want is for the sidebar (currently located underneath) to be displayed alongside the green area.