I have made the box and the lid. I want to close the box with the lid. I have selected the edge and with the 3d cursor as pivot point im rotating. with the x axis i rotate i hit x twice also but its not working. Why its moving from the position. Any suggestion or help plz.
You need to change the Transform Orientation. In some case, changing to local orientation will work, but in your case, you need to create a new referential :
Create specific Transform Orientation
On edit mode, select an edge that has the correct direction for the pivot of the box. (for example the edge on the bottom of the lid )
Press n to open the right menu in the 3D view. Find the "Transform Orientations" menu and press on the little +. This will create a new orientation that you will use for your rotation.
Go back on object mode and change the transform orientation (on the bottom of the 3d view) to your newly created orientation wich should be named "Edge" or "Edge.00x".
You can now use the 3d manipulator to rotate the top of your box along the newly referential created.