i have a div and it appears only if the user hits a link from category list i.e
category 1
category 2
category 3
and loading content with jquery $.ajax() so the width of div chages according to the returned data no i want to center the div in center of page…
If you want to put an element exactly in the center of your browser , Assign theses styles to the element:
Here i supposed my element has 100 px height and 200 px width, So in margin i put it 1/2 of real size . This way my element is exactly in center of my page , no matter how size is my browser .
Here is an online demo