Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(TIP) CSS to make figcaption responsive #243

Open
xavierve opened this issue Jan 7, 2021 · 0 comments
Open

(TIP) CSS to make figcaption responsive #243

xavierve opened this issue Jan 7, 2021 · 0 comments

Comments

@xavierve
Copy link

xavierve commented Jan 7, 2021

Hi there. Love your baguette :-)
I use figcaption to show the "a href TITLE" text, but it seams to be not 100% responsive, beacause text is showed at botton of mobile device on portrait mode, to far away of normal images.
To fix it a modify the BOTTOM property of FIGURECAPTION element, so in PORTRAIT devices caption moves to 29% of the height of the viewport and, on wider-than-taller devices (LANDSCAPE) remain at very bottom with 0%

I bring you here the code I used if it helps somebody

1- Being mobile first, this is the first part of the rule (whitout breakpoint)
#baguetteBox-overlay .full-image figcaption {
display:block;
position:absolute;
bottom:29vh; /* change for responsive, captions UPPER on portrait /
width:100%;
text-align:center;
line-height:2.8; /
changed for design /
white-space:normal;
color:#ffffff; /
changed for design /
background-color:#000;
background-color:rgba(0, 0, 0, 0.36); /
changed for design */
font-family:sans-serif;
}

2- Breakpoint for screens oriented LANDSCAPE (when wider than taller screens -CSS3 Orientation property on Media Querird.-)
@media screen and (orientation:landscape) {
#baguetteBox-overlay .full-image figcaption { bottom: 0vh;} /* change for responsive, captions at BOTTOM on landscape*/
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant