I need to place a div
(with position:absolute;
) element in the center of my window. But I am having problems doing so, because the width is unknown.
I tried this. But it needs to be adjusted as the width is responsive.
.center {
left: 50%;
bottom:5px;
}
Any ideas?
You can place the image in a div and add a div id and have the CSS for that div have a
text-align:center
HTML:
CSS :
This works for me:
This solution works if the element has
width
andheight