The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. On-Page / Site Optimization
    4. Background Images and ALT text

    Background Images and ALT text

    On-Page / Site Optimization
    6 4 30.0k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MichaelGregory
      MichaelGregory last edited by

      We pretty much exclusively use background images for our sites. How do I add in alt text? I tried a Google search for this issue and the best answer I could find was "Use the 'title' tag in the containing div", but that was from 2010.

      Is there a better way to do it? And no, we're not going to switch to using standard images, because background images are way more slick for UX.

      1 Reply Last reply Reply Quote 0
      • erickcalderon
        erickcalderon last edited by

        I think that adding title to the div is the only way for you to do a background image in CSS.

        You can cheat a little by then loading a transparent image in the container that the background image is in, make this transparent image have an alt tag and title tag for whatever your background image is about.

        If you are doing this for seo purposes this should work, if you are doing it to have the html well formatted, there is only the div tag.

        Cheers!
        -Erick

        1 Reply Last reply Reply Quote 2
        • MichaelGregory
          MichaelGregory last edited by

          I'm going with "Google is too smart for that" on the transparent image alt text front. I guess it would help out people using a screen reader, but I'd like to get some of the images into Google image search. It seems like alt text is pretty much required to rank for that?

          1 Reply Last reply Reply Quote 1
          • erickcalderon
            erickcalderon last edited by

            Yes for screen readers and using it as alt and title for your images that are there. So you are not trying to trick Google, you are trying to figure out a way to mark what is actually there. For google image search, I have had success ranking images even if used as backgrounds in divs by naming them with what I was trying to rank them for. Since I could not use alt or title I named images with my target in them. These images were all for a brand query.

            Example: image on mybrand.com named mybrand-imageName.png

            we were able to get most of those images to show up when doing an image search for mybrand

            1 Reply Last reply Reply Quote 1
            • Mobilio
              Mobilio last edited by

              You can't use ALT text to background images.

              If your images are loaded as img tag then you have title, alt. Example:some alt

              But background images isn't regular images loaded with img tag. They can be loaded only with CSS styling. And therefore they doesn't comes with title and alt. Example:

              As you can see you can't use title or alt for image there. Only way is to define title as this:

              or better this one:
              some alt
              I know that isn't 100% background but also helps.

              Alternative way can be ARIA. If you love background images but really wish alt text you can use WAI-ARIA and define them as:

              ...
              But GoogleBot doesn't support aria-label for now.

              nans 1 Reply Last reply Reply Quote 3
              • nans
                nans @Mobilio last edited by

                Does it has any positive effect on ranking? (seo)

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                • Can I put the company name in the image alt text instead of just the service type im trying to rank for?
                  Vijay-Gaur
                  Vijay-Gaur
                  0
                  4
                  1.1k

                • HTML Copy in Image Alt Text Field
                  Andrew-SEO
                  Andrew-SEO
                  0
                  2
                  56

                • How to deal with hundreds of externally-generated images with no alt text?
                  Roman-Delcarmen
                  Roman-Delcarmen
                  0
                  4
                  72

                • Alt and title tags on images
                  jesse-landry
                  jesse-landry
                  0
                  6
                  2.3k

                • Image with Text
                  DarinPirkey
                  DarinPirkey
                  0
                  4
                  252

                • Image titles and alt tags for multiple images
                  TBSEO
                  TBSEO
                  0
                  4
                  937

                • What's the maximum length (number of spaces) for the Alt Image Text?
                  Bidofvic
                  Bidofvic
                  0
                  3
                  17.7k

                • Image ALT Attribute
                  OTSEO
                  OTSEO
                  0
                  8
                  7.0k

                Get started with Moz Pro!

                Unlock the power of advanced SEO tools and data-driven insights.

                Start my free trial
                Products
                • Moz Pro
                • Moz Local
                • Moz API
                • Moz Data
                • STAT
                • Product Updates
                Moz Solutions
                • SMB Solutions
                • Agency Solutions
                • Enterprise Solutions
                • Digital Marketers
                Free SEO Tools
                • Domain Authority Checker
                • Link Explorer
                • Keyword Explorer
                • Competitive Research
                • Brand Authority Checker
                • Local Citation Checker
                • MozBar Extension
                • MozCast
                Resources
                • Blog
                • SEO Learning Center
                • Help Hub
                • Beginner's Guide to SEO
                • How-to Guides
                • Moz Academy
                • API Docs
                About Moz
                • About
                • Team
                • Careers
                • Contact
                Why Moz
                • Case Studies
                • Testimonials
                Get Involved
                • Become an Affiliate
                • MozCon
                • Webinars
                • Practical Marketer Series
                • MozPod
                Connect with us

                Contact the Help team

                Join our newsletter
                Moz logo
                © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                • Accessibility
                • Terms of Use
                • Privacy