Advertisement:

Author Topic: Full width banner - automatically scales to any screen size  (Read 26011 times)

Offline landyvlad

  • Jr. Member
  • **
  • Posts: 182
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Full width banner - automatically scales to any screen size
« Reply #40 on: February 27, 2017, 08:22:58 AM »
Thanks I'll have a go.
I'm new at this - thanks to everyone for their help !

Offline jeannepatrickson

  • Newbie
  • *
  • Posts: 1
Re: Full width banner - automatically scales to any screen size
« Reply #41 on: March 13, 2017, 09:56:10 AM »
Hi,

That's a great post.

I've a doubt. Is there any option for adding alt text for background images.

I know it's an off-topic. Can any one help me on this.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 53,863
  • Gender: Male
    • Kindred-999 on GitHub
Re: Full width banner - automatically scales to any screen size
« Reply #42 on: March 13, 2017, 09:58:36 AM »
no. background images do not have alt-text at all in HTML code
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 66,507
    • Arantor on GitHub
Re: Full width banner - automatically scales to any screen size
« Reply #43 on: March 13, 2017, 10:08:13 AM »
You can do some voodoo to have text there and just pushed out of sight so screen readers can do it, but it's... not entirely straightforward.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,113
  • Master of BBC Abuse
Re: Full width banner - automatically scales to any screen size
« Reply #44 on: March 13, 2017, 05:36:07 PM »
Oh? Do tell. :D

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 66,507
    • Arantor on GitHub
Re: Full width banner - automatically scales to any screen size
« Reply #45 on: March 13, 2017, 05:47:19 PM »
text-indent: -9999em ;)
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,113
  • Master of BBC Abuse
Re: Full width banner - automatically scales to any screen size
« Reply #46 on: March 13, 2017, 11:52:44 PM »
Yes I know that trick (and there are other ways of doing it too*) but the question was about CSS background images. ;)

*visibility: hidden; or
position: absolute; z-index: -99; or
height: 0; overflow: hidden; or...

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 66,507
    • Arantor on GitHub
Re: Full width banner - automatically scales to any screen size
« Reply #47 on: March 14, 2017, 01:38:33 AM »
Same deal. An element with a background image can still have textual content with its text shoved out of sight and get the benefits of both.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,113
  • Master of BBC Abuse
Re: Full width banner - automatically scales to any screen size
« Reply #48 on: March 14, 2017, 02:55:30 AM »
Well yes, although the question was strictly about having an alt tag on a background image. IOW, something that would be visible if the image 404'd, or if images were disabled in the browser, which is not possible AFAIK.

Having non-visible text in most HTML elements is easy enough. There are umpteen ways of doing that. You can even just use color: rgba(0,0,0,0); if you like. That'll work.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 66,507
    • Arantor on GitHub
Re: Full width banner - automatically scales to any screen size
« Reply #49 on: March 14, 2017, 03:37:33 AM »
I assumed it was for the infamous SEO purpose where it would actually work better than an alt tag.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.