For an image which is in the CSS and not the HTML, can you add an alt tag?
-
I would like to improve SEO on a page with three big images, which are currently hosted in the CSS. The sample I am working with is at http://xquisitevents.com/about-us/
and I put my cursor over the big picture of the wedding dress with bouquet, I inspected the element and saw this code in a div tag:
#upperleft {
- background-image:url(images/AboutTopLeft.jpg);
Can I add an alt tag to the CSS somehow, or can I have it added to the HTML? What is the best way to handle this, to include keywords like
exquisite weddings and special event designs?
-
further to this you could look at having the image above some text and the text describes the image -- using z-index to layer them - hope that makes a little sense... if not google z-index
-
Hi Bridget,
There is no alt attribute in css, so no you cannot add it there,
There are a couple of things you can do.
1. Optimizing your image file names will at least give an indication of what the image is about and
2. Rethink your css and the use of background images. Specifically you could get the same effect as you have now without background images using a combination of absolutely and relatively positioned divs. This way you can have the same layout as now but with the image in the html rather than the css and alt tags will be available for them.
Check the link here for some demo code: http://stackoverflow.com/questions/8708945/how-to-position-text-over-an-image-in-css
Hope that helps!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Optimization expert suggesting we add Canonical tag to every page on site
Hi guys, We're currently launching a new page, and we have an optimization and technical SEO expert (highly rated on Upwork, very intelligent, has solved complicated issues in the past and improved our Core Web Vitals greatly) suggesting we put canonical tags on every page of site, pointing to itself (other than the case of where canonicals should point to other page, we have those listed separately. Do you guys see a benefit to this? Could it harm us? He says large retailers do this, couldn't quite glean the benefit from it though. Current site ranks well and isn't set up like this. Any insight would be much appreciated! Thanks!
Technical SEO | | CitimarineMoz0 -
What is the correct Canonical tag on m.site?
We have 2 separate sites for desktop (www.example.com) and mobile (m.example.com) As per the guideline, we have added Rel=alternate tag on www.example.com to point to mobile URL(m.example.com) and Rel=canonical tag on m.example.com to point to Desktop site(www.example.com).However, i didn't find any guideline on what canonical tag we should add ifFor Desktop sitewww.example.com/PageA - has a canonical tag to www.example.com/PageBOn this page, we have a Rel=alternate tag m.example.com/pageAWhat will be the canonical we should add for the mobile version of Page Am.example.com/PageA - Canonical tag point to www.example.com/PageA -or www.example.com/PageB?Kalpesh
Technical SEO | | kguard0 -
WordPress Slideshow Gallery Not Showing Alt Tags or any relavent info ?
Hi guys i have started adding my seo tags to my image keywords ie alt tags captions etc.... but when i go to inspect the slideshow that image then appears in there none of the alt tags etc in them? Does anyone know how to add then?
Technical SEO | | hemeravisuals0 -
Hreflang tag implentation
Hi, We've had hreflang tags implemented on our site for a few weeks now, and while we are seeing some improvements for the regional subfolders I wanted to double check I had the tags implemented correctly (a couple of examples are below). However while the regional subfolder sites are now ranking instead of the US site for some keywords, some key search terms are still returning the US site. Could this be due to incorrect implementation for that specific page? Due to complications with using Magento we're implementing the tags in the site maps. Also magento appears to be inserting a rel canonical tag automatically for each page and self referencing e.g. On www.example.com/uk/security-cameras (one of the pages we're having issues with) the canonical tag is http://www.example.com/uk/security-cameras" />. Is this an issue? Any advice would be appreciated. Thanks. <url><loc>http://www.example.com/uk/dvrs-kits</loc>
Technical SEO | | ahyde
<lastmod>2014-07-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.5</priority></url>
<url><loc>http://www.example.com/uk/dvrs-kits/1080p</loc>
<lastmod>2014-07-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.5</priority></url>0 -
Div tags vs. Tables
Is there any reason NOT to code in tables (other than it being outdated) for SEO reasons?
Technical SEO | | EileenCleary0 -
Duplicate page content - index.html
Roger is reporting duplicate page content for my domain name and www.mydomain name/index.html. Example: www.just-insulation.com
Technical SEO | | Collie
www.just-insulation.com/index.html What am I doing wrongly, please?0 -
Can I remove 301 redirects after some time?
Hello, We have an very large number of 301 redirects on our site and would like to find a way to remove some of them. Is there a time frame after which Google does not need a 301 any more? For example if A is 301 redirected to B, does Google know after a while not to serve A any more, and replaces any requests for A with B? How about any links that go to A? Or: Is the only option to have all links that pointed to A point to B and then the 301 can be removed after some time? Thank you for you you help!
Technical SEO | | Veva0 -
Can spammy links affect indexing?
Meaning, if you have a lot of bad quality links (directories, blog comments) that are giving great rankings for some terms (on a homepage of a site), could the low quality of these links negatively affect the crawling frequency of interior pages or perhaps even give interior pages a ranking penalty?
Technical SEO | | qlkasdjfw0