Hey there! I've encountered a little issue with this code snippet: https://jsfiddle.net/jmg63s3e/1/
The code works perfectly when you resize the browser window to align the text
with the image
, which is exactly what I want. However, as soon as you continue to resize it, the text
ends up dropping below the image
, even if the width of the wrapper
is much smaller than the window.
All I'm aiming for is:
- To have the entire
wrapper
centered both horizontally and vertically in the browser window, without knowing its total width and height as they depend on its children. row1
androw2
should not be inline;row2
must appear belowrow1
.- All elements within
row1
(theimage
and thetext
containing 2 spans) should be inline with each other. - The
spinner
insiderow2
must also be centered within the row, although I haven't faced any issues with that in my attempts so far.
The only dynamic element in the code is the first span containing something like Player #1
, as it represents the player's name and can vary in length.
If I need to make it responsive, I'll resort to media queries or adjust widths, heights, and font-sizes dynamically through JS, but at this stage, my concern lies solely with the wrapper
itself. The text
keeps dropping below the image
despite the wrapper
being narrower than the window, making it challenging to tackle the situation without a known width for the wrapper
. Can anyone offer me some insights or solutions? Any suggestions would be greatly appreciated, provided they are CSS-based and exclude JavaScript. Thanks in advance!