Home › Forums › CSS › centering absolutely positioned elements with left: 50% and -33% left margin › Reply To: centering absolutely positioned elements with left: 50% and -33% left margin
June 18, 2014 at 4:51 am
#173041
Kiran
Participant
Hi,
You can center align a div horizontally and vertically by writing this code in css:
#nameofdiv
{Position: absolute;
Left: 0;
Right; 0;
Bottom: 0;
Top: 0;
text-align: center;
line-height: 50px;
}
Hope this will resolve your problem.