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
-
Does a tag inside H1 affect SEO?
We are using a tag inside our H1 tag to display a second line of text, usually for extra information and making the tag appeal like a intro text for the visitor and not just a optimized SEO tag. Example: https://www.denhollandsche.nl/grafmonumenten/ Does this technique affect SEO? Should we consider removing it? Natuursteen grafsteengraniet grafmonument voorbeelden
Technical SEO | | stepsstones0 -
Why are my images not being indexed?
I have submitted an image sitemap with over 2,000 images yet only about 35 have been indexed. Could you please help me understand why Google is not indexing my images? www.creative-calendars.com
Technical SEO | | nicole20140 -
Reciprocal links and nofollow tag
What happens if I link to a site using the nofollow tag and they are linking back to me with a dofollow link? Will it give me as much power and link juice as if it was a one way link (to me) or will Google discount the link because it's reciprocal?
Technical SEO | | Livet0 -
• symbol in title tag
We have a few title tags with a circular dot symbol, which is created by the code "•" Humans see a dot, but googlebot sees • Does this negatively impact our SEO, or is googlebot aware that **• == *** to human eyes
Technical SEO | | lighttable0 -
Tags - Should i add description for every tag ?
Hi 🙂 Should i add description for every tag in wordpress and i am using Yoast WordPress SEO and there is also option to add SEO title for tags , should i add also titles for tags ? and how should look title for tag, can you give me example from my blog : http://www.dota2club.com thank you !!!!
Technical SEO | | wolfinjo0 -
How can you tell if a 301 has been set up correctly?
How can you tell if a 301 has been set up correctly. We had a .co.uk site that has moved over to a .com However the .co.uk we have hasd problems with the old webmaster giving control, but he has said he has implemented a 301 redirect to the new .com site, and if you click on .co.uk it does transfer you to the .com site How can we check that it is a 301 set up and not another sort of redirect?
Technical SEO | | ocelot0 -
One H1 tag Dead Long Live multiple H1 tags?
Good afternoon from 9 degrees C mostly cloudy Wetherby UK, Ive been holding on to the mantra of one h1 tag per page but a developer has challenged me on this by stating you can have multiple h1 tags on the condition the page is HTML 5 & each h1 tag is within its own section or article tag. So the question is do i need to change my tune? Thanks in advance, David
Technical SEO | | Nightwing0 -
Canonical Tag
Does it do anything to place the Canonical tag on the unique page itself? I thought this was only to be used on the offending pages that are the copies. Thanks
Technical SEO | | poolguy0