Hi there I have a question with regards to CSS I am using a css template for my site which divides the page into a header, content and footer in the header there is an image for a banner so each p-age will have this image in the top. my question is can i assign an alt value for this as for SEO purposes I am oloosing an alt tag on every page. is this possible to do many thanks Gerard
I'm not sure I understand very well what you mean. Do you want to show a text image (logo), but still let search engines know the text contained in it? I think an alt attribute could help. Something like this: <img src="banner.gif" alt="name-of-the-banner" /> Code (markup): So, when search engines crawl your site, they would "understand" the image. If you have a text image as your logo and still want to use a H1 tag for your title so that search engines can read it, using CSS, you could put the image in the background of the h1 tag and make the H1 text invisible to people by using a negative text-indent value. If that's what you want, I will post how to do it. Just let me know.
hi there the image is in the external css file (see code below) I want to assign an ALT value in the css if its possible /*BANNER*/ #banner { float : left; width : 720px; height : 200px; margin-left: 0px; padding : ; margin-bottom : 0; background : #eee url(img/header2.gif); } #banner h1 { margin : 140px 0 0 20px; font : normal 2em georgia, verdana, arial, tahoma, sans-serif; text-transform : none; letter-spacing : 3px; color : #ffffff; background : transparent;
You can't do it. Need to move the image out into the Html of the page and insert your ALT text there. There may be an anchor link around the #banner div in your Html however. You could apply the TITLE attribute to the anchor link. Example <a href="linktohomepage" title="My homepage with some keywords here"><div id="banner"><h1>My Homepage</h1></div></a> Code (markup):
yep if ur using CSS to display the image u lose the right to use an aLT tag. .but i wouldnt worry too much .. it wont affect SEO by that much
You should only add images from within your CSS file if they are for presentational purposes only. So it would make no sense to add an alt tag to them. If your image is part of your content, then I would add it using <img>. N.B. This is only MY way of doing things, I know there are some members of these forums who will probably disagree with me.
use images in css for background or custom built points on list etc.. if you need images on content, insert it in the HTML