-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Center alt text and document configurable <Image /> styling #18761
Comments
Temporary fix until vercel/next.js#18761 is fixed.
Unfortunately, there’s no consistent way to style image alt text with CSS besides color/font size/etc that I can find—Chrome & some browsers support displaying pseudoelements when the image can’t load, but it’s not in every browser, & personally I don’t think Next should apply psuedoelements that make styling the nested divs even harder. There could be a hacky way of using aria attributes & inserting the text as its own node, but that would require a bunch of accessibility testing & customizing the styling would be super tough. |
@lachlanjc That current solution of |
Ah got it, must just not be supported on iOS Safari then 👍 |
The alt text no longer renders with the default placeholder ( In Next.js 11, we introduced Do you still want alt text displayed or does the new behavior solve your problem? |
I think that should solve my problem! Thanks @styfle (I'm guessing you're just going through old issues... kudos for that)! |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request
Is your feature request related to a problem? Please describe.
Right now, the lazy loading image component looks like this:
There are a couple of problems with this IMO:
alt
text centered in the middle of the image.Describe the solution you'd like
You should expose and document a way to customize the image styling and the lazy loading styling as well. Or, at least center the
alt
text using:Describe alternatives you've considered
Right now, I can hackily style some things by adding styles to the
img
component like so:But this doesn't address the lazy loading styles (because I can't figure out what selectors to use for lazy loading because it loads too fast before I can get my inspector open).
The text was updated successfully, but these errors were encountered: