Horizantal problem in CSS
-
Hello everybody, I want to set a div in the vartical and horizantal center of an div. how can i set? There is a property for text-align and vartical-align but these are for text not for any element. please help me. Thank you. :-O
Dipak
-
Hello everybody, I want to set a div in the vartical and horizantal center of an div. how can i set? There is a property for text-align and vartical-align but these are for text not for any element. please help me. Thank you. :-O
Dipak
For horizontal centering you need to set the style "text-align:center;" on the outer DIV and then "margin-left:auto;margin-right:auto;" on the inner DIV. This should work for all elements in Firefox as well as Internet Explorer.
-
For horizontal centering you need to set the style "text-align:center;" on the outer DIV and then "margin-left:auto;margin-right:auto;" on the inner DIV. This should work for all elements in Firefox as well as Internet Explorer.