Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
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! 
Browse Questions
Explore more categories
- 
		
		Moz ToolsChat with the community about the Moz tools. 
- 
		
		SEO TacticsDiscuss the SEO process with fellow marketers 
- 
		
		CommunityDiscuss industry events, jobs, and news! 
- 
		
		Digital MarketingChat about tactics outside of SEO 
- 
		
		Research & TrendsDive into research and trends in the search industry. 
- 
		
		SupportConnect on product support and feature requests. 
Related Questions
- 
		
		
		
		
		
		# Tag - opacity and SEO impact
 Hello, Technical SEO | | Tiffany_Barn
 I have a query animation 'fade-in-up' on my website: tiffanybarnard.com which moves the H1 tag slightly and fades it in from zero opacity to 1. Will this affect the SEO value of the H1 tag?
 Thank you!0
- 
		
		
		
		
		
		Does google look at H3 tags?
 I've had someone tell me that google doesn't pay attention to H3 tags -- only H1 and H2. I haven't found much online to back this up or discredit it; thought I'd ask the Moz community! Technical SEO | | LivDetrick5
- 
		
		
		
		
		
		I am trying to generate GEO meta tag for my website where on one page there are multiple locations My question is, Can I add GEO tagging for every address?
 Am I restricted to 1 geo tag per page or can i add multiple geo tags ? Technical SEO | | lina_digital0
- 
		
		
		
		
		
		Add trailing slash after removing .html extention
 My website is non www ,it has wordpress in subdirectory and some static webpages in the root and other subdirectory 1. i want to remove .html extention from the webpages in the root and Technical SEO | | Uber_
 the others static webpages in subdirectory.
 2. add slash at the end.
 3. 301 redirect from non slash to url with slash. so it should be http://ghadaalsaman.com/articles.html to http://ghadaalsaman.com/articles/ and http://ghadaalsaman.com/en/poem-list.html to http://ghadaalsaman.com/en/poem-list/ the below code 1. working with non slash at the end **2. **redirect 301 url with slash to non here's my .htaccess <ifmodule mod_rewrite.c="">Options +FollowSymLinks -MultiViews RewriteEngine On
 RewriteBase /</ifmodule> #removing trailing slash
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)/$ $1 [R=301,L] #www to non
 RewriteCond %{HTTP_HOST} ^www.(([a-z0-9_]+.)?domain.com)$ [NC]
 RewriteRule .? http://%1%{REQUEST_URI} [R=301,L] #html
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^([^.]+)$ $1.html [NC,L] #index redirect
 RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.html\ HTTP/
 RewriteRule ^index.html$ http://ghadaalsaman.com/ [R=301,L]
 RewriteCond %{THE_REQUEST} .html
 RewriteRule ^(.*).html$ /$1 [R=301,L] PS everything is ok with the wordpress , the problems with static pages only. Thanks in advanced0
- 
		
		
		
		
		
		Can I set a canonical tag to an anchor link?
 I have a client who is moving to a one page website design. So, content from the inner pages is being condensed in to sections on the 'home' page. There will be a navigation that anchor links to each relevant section. I am wondering if I should leave the old pages and use rel=canonical to point them to their relevant sections on the new 'home' page rather than 301 them. Thoughts? Technical SEO | | Vizergy0
- 
		
		
		
		
		
		What punctuation can you use in meta tags? Are there any Google does not like?
 So I know you can use dashes and | in meta tags, but can anyone tell me what other punctuation you can use? Also, it'd be great to know what punctuation you can't use. Thanks! Technical SEO | | Trevorneo1
- 
		
		
		
		
		
		ALT attribute keyword on the same image but different pages
 Hi there, As i'm sure you're probably aware, moz advises to use a keyword within the ALT attribute on pages... On a new website I am launching, I have the ability to add an alt keyword to image headers. On multiple pages we have the exact same image but with different keywords associated them inside the alt attribute. The image itself is a collage of different images and so the keywords used can, quite sneakily, match the image. My question is therefore, will using different keywords on the same image on different pages have a negative effect on SEO? Thanks, Stuart Technical SEO | | Stuart260
- 
		
		
		
		
		
		Robots.txt and canonical tag
 In the SEOmoz post - http://www.seomoz.org/blog/robot-access-indexation-restriction-techniques-avoiding-conflicts, it's being said - If you have a robots.txt disallow in place for a page, the canonical tag will never be seen. Does it so happen that if a page is disallowed by robots.txt, spiders DO NOT read the html code ? Technical SEO | | seoug_20050
 
			
		 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				