I have ceated a dropdown menu using the following css
.menu li ul {display: none;}
.menu li:hover > ul {display: block;}
But the problem is whenever the menu dropsdown the content below shifts down. How can I prevent that.
You can prevent that by positioning the sub menu absolute.
.menu li ul {display: none; position: absolute; }
You also have to set
.menu { position: relative; }
as said in the comment by Tae. If you do not, the sub menu will probably set to the top left corner of the page.
position:relative;, or the submenu will be positioned relative to the browser window.