andreassoteriou Posted September 11 Share Posted September 11 Hello all, I want to add the caption on my gallery as a transparent strip on the bottom of the image when viewing on mobile. I have used the same code as in the desktop view (>640px) but changed the following: - Height 10% - Position as flex-end (does seem to end up on the top instead??) Ideally I want the caption to be at the bottom of each image, and I do not want a hover effect either. It should be there permanently so to speak, anyone know what I am doing wrong here?Currently working from below code: @media only screen and (max-width:640px) { .gallery-grid .gallery-caption { position: absolute; top: 0; left: 0; background: rgba(0,0,0,0.4); // overlay color height: 10%; padding: 0; opacity: 0; pointer-events: none; } .gallery-grid .gallery-caption-wrapper { display: flex; align-items: flex-end; // center vertically justify-content: center; // center horizontally } .gallery-grid .gallery-caption-content { font-size: 1.2rem !important; // caption font size color: white; //caption font color padding: 1vw; // padding around the caption text-transform: none !important; } .gallery-grid-item { position: relative; } .gallery-grid-item:hover .gallery-caption { opacity: 1; } .gallery-caption-grid-simple { transition-delay: 0ms; max-width: unset; } } Link to comment
andreassoteriou Posted September 11 Author Share Posted September 11 Should mention. Link: andreassoteriou.com/projects password: letstrythisout Link to comment
Solution tuanphan Posted September 14 Solution Share Posted September 14 To move caption to top, use this CSS code @media screen and (max-width:767px) { figcaption.gallery-caption.gallery-caption-grid-simple { bottom: unset !important; top: 0 !important; } } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
andreassoteriou Posted September 14 Author Share Posted September 14 13 hours ago, tuanphan said: To move caption to top, use this CSS code @media screen and (max-width:767px) { figcaption.gallery-caption.gallery-caption-grid-simple { bottom: unset !important; top: 0 !important; } } Thank you! Actually yes this worked! Many thanks Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment