Having an issue with keeping text centered in the middle of a div that overlaps an image. It looks fine on desktop but when I try to make it mobile-friendly, things go haywire. I believe the problem lies in using fixed heights for the div, as setting height:auto; just aligns the text to the top since the actual height is unknown. Does anyone have a better approach to solve this?
To provide context, here's the website where the issue can be seen: The problematic area is the three large images displayed in the center of the page.
Currently, this is the CSS code I am utilizing:
span.text-content, div.homepage-bags span.text-content-bags { color: #fff; display: table; font-size: 30px; left: 0px; position: absolute; top: 0px; text-shadow: 2px 1px 3px rgba(0, 0, 0, 0.5), 0px 1px 3px rgba(255, 255, 255, 0.5); text-transform: uppercase; width: 100%; }
div.homepage-featured span.text-content { height: 620px!important; }
div.homepage-buckets span.text-content { height: 288px!important; }
div.homepage-bags span.text-content-bags { height: 288px!important; }
div.homepage-featured span.text-content span, div.homepage-bags span.text-content-bags span { display: table-cell; text-align: center; vertical-align: middle; }