TornikeTt
@TornikeTtAll solutions
article-preview-component
#sass/scssSubmitted 7 months agoSo, to overcome and complete this challenge, I created two media containers:
-
The first one is for the desktop layout, which I placed inside the tag. (This is because when the media container becomes position: absolute, I want the share button—also inside the tag—to be positioned relative to it and correctly calculate the position to center the media container.)
-
The second one was placed outside the tag (as a sibling of ). I did this to calculate the 's width and position, which I used to determine the media container's position for the mobile device layout.
Question: Is this approach—creating two similar elements and showing one while hiding the other at different times—considered bad practice?
-