I have a really simple question.
In HTML links (a href), can I use title and alt? Or only Title?
I know for images title and alt can be used at the same time. But what about links as I have mentioned?
Thank you.
Trying to get an answer to a simple question.
Example:
test
I have searched online but couldn't find a definitive answer.
some browser will not support your image or link or title that is why we always use alt. alt is alternative text which shuld be shown when an image or link is not supported by browser
some browser will not support your image.link is not supported by browser
Related
I'm looking for a cross browser solution to display information when "hovering" on an element, I know this can be done with JS dynamically but I'd prefer in this specific case a basic static HTML solution.
According to mozilla developers website (here) using title instead of alt is the best practice but I'd like more "field experience" to help me decide if I should go for ALT, TITLE attr or JavaScript
Thank you very much
Title attribute is for tooltips and is supported by all major browser. You should use it.
Alt attribute isn't about tooltips at all.
When defining a title or alt to an anchor tag, which is valid HTML5?
Is it best to define both, or only one?
Does it affect SEO at all?
in HTML, even from version 4, the title attribute is valid for almost all elements. alt is different in that it's only valid for images, the idea being to provide a text only alternative version of the image, which would be useful to people with visual impairment (as they'd be able to hear their browser read the text)
It's good practice to provide an alt attribute for images, even if you're going to leave an empty string ( "" ). The alt attribute helps improve accessibility for screen readers since the user most likely can't see the image with which it's associated. The title is less useful for accessibility purposes but is still a good practice to get into.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
Does the title attribute in a link do the job of the real text in the link for SEO?
i.e
Web Design
is it the same as:
click here
when trying to get a good page rank for keywords like "web design"? is it like alt attribute in an image tag? or is it useless in SEO?
is it the same as:
click here
what's the difference between all the above?
Thank you in advance!
Alt is not a valid attribute for <a> elements.
Use alt to describe images
Use title to describe where the link is going.
The textvalue (click here) is the most important part
The title attribute gets more and more ignored.
Google looks far more on the link text than the title attribute.
For google the title tag is like a meta tag which is not important compared to content.
Image alt tags are however still very important (especially for image search)
The main feature of those tags is to provide usability for your users, not to feed informatino to search engines.
title attribute hasn't the same value as link text on SEO.
between
Web Design
and
click here
stick with the first option. But it is duplicate data, and has no real aggregate value on the case.
The main title purpose, it to give a tooltip about the link's page title. Putting the linked page title is the correct application (think on user first).
The alt attribute is for allow non-textual content to be represented. Consider the examples on WHATWG: http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#alt
EDIT
1
<span>2</span>
3
...
27
The title tag should be used to provide ADDITIONAL information for an element such as a link. If your title tag duplicates the actual link text then it will have no SEO benefit (there are arguments that the duplication could have a slight negative effect too). If, however, you can provide additional, meaningful information on the link such as further details about the content linked (especially if it links to a filetype that Google wouldn't be able to access/index) then they're definitely worth having.
Even as the tooltip in the browser, having a tooltip with the same text as the link text makes no sense, so as a rule of thumb only use it when you have something additional to add, not duplicate.
HTH
The text in the title attribute is not seen by crawlers. It won't cause keyword stuffing and it won't replace the anchor text for a given URL. It will, however, provide additional info if this is needed.
Use it to help your visitors not your SEO efforts.
alt is only valid for images — it's alternate text that serves for screen readers and people with images turned off to understand what an image represents.
title applies to most (if not all) elements, and can be used to provide tooltips for more information about parts of your pages.
I don't think either attribute plays any major roles in SEO. As Joe Hopfgartner says, the actual text of your links is much more significant in terms of semantics, which is why using "click here" as link text is discouraged these days.
Use this pseudo-code:
Text
For instance, this:
Example
renders like this:
Example
I have a question regarding title tags. I have been using them on every link on my site in the hope that it will be good for SEO. Because I have so many title tags in use it looks very crazy to actually visit. No matter where you point there's another title popup. Is there any way to prevent these hovers (the ones that show the content of the title tag) while still using title tags?
Thank you for your answers.
Quit overobsessing about "SEO".
The title tag is for information about the link (target). If you use it for keyword lists or something like that, then stop. If you simply duplicate the link text, there's no need. If you use it correctly, you shouldn't worry about the tooltip that browsers display.
You could use JavaScript to remove the title attribute (not tag).
But as the others said, the title attribute is intended to provide “advisory information about the element for which it is set”. So don’t spam the user with useless information just because you heard/read that search engines love that.
I fully agree wuth Joel (+1), imho now you achieve reverse effect: your site looks like one big fake to google without real content :)
The best "rule of thumb" I have heard and experienced in a positive way with SEO is to make a great site for your visitor and let the search engines take care of themselves. It sounds like you are making a site for Google and making the visitor miserable which is the exact opposite of successful SEO.
Remember, without the visitor it doesn't matter what your SE placement is.
<a onMouseOver="javascript: this.title='';" href="../path/to/image.jpg" title="some title here">link</a>
I agree with others though, you should not sacrifice usability, integrity of content and the site's design in order to achieve better SE ranking.
As Andy (and others) note, you may be confusing the Page Title tag with the Link title attribute.
To clarify, in terms of SEO:
Page Title tags on pages ARE very important for SEO
Link title attributes are very minor and not worth upsetting user experience with.
I have not tried this myself, and I am not sure how Google feels about it:
But what about putting all your title tags where you want them, for the SEO, then after the onload event is fired, simply null them all at once by finding all elements that have the title attribute and setting them to "". This way, the user is not beaten-to-death by title tags as they try to stumble their way through your page....?
In Prototype, I use the $$() function to get all items of a specific class and it works like a champ.
How to write good alt text for images to help screen reader and blind user to understand what is picture about ? and if we are using Alt text then what should be in a Title="text" if we are using both in special cases like menu images etc
I'm a screen reader user and will use Stack Overflow as an example of both the good and bad.
Alt tags should be brief and descriptive. For example, Stack Overflow's alt tags for the vote up and vote down options are nice since they don't take long to read and get to the point quickly. Examples of bad alt tags are the make this question a favorite and accept this answer. Neither of the tags are descriptive, the favorite tag is just "*" and the accept the answer tag is "check" The only way for me to tell what they are is to read the source or have someone sighted let me know what they are for.
As far as title attributes go I don't really have much advice. My screen reader doesn't read them by default so I don't normally use them. An example of something that could be useful is additional information. For example the reason my accepted answer rate is so low is because I have no way of telling whether I have accepted an answer on a question. It would be nice if the title attribute on the accept this answer graphic would say something like "click to accept this answer" if the answer wasn't accepted and "Click to remove this answer as the accepted answer" if it is the accepted answer.
You should not make the visually impaired user understand what the image is all about. For the blind, the image effectively doesn't exist, all that there is is the text.
The alt text should work as a single sentence/paragraph that can be replaced for the image, convey the same content and still make sense in the context of the adjacent content.
If the image is something that is part of the GUI, then the alt text should convey an action (a verb), line upvote, answer this or log out.
You should visit your site with links and try to understand your site. If there is for example a pie chart, its alt text should be a small summary of the percentages. If you just have a pretty flower next to a blog post, don't give it an innane alt text like flower image companion of blogpost #324 or even worse flower.jpg.
If the image is important to the navigation or to get information, try to give it an alt text that makes the site work without the image. If the image is only presentational, give it an empty alt text.
title, as far as I know, should only displayed when hovered, so they should give extra information to the image, so useless duplication of information should be avoided. For screen readers, this is a bit trickier, as support and configuration can be very different between users.
Some empirical data shows title as useless:
Most users of screen reading software do not change their default settings to access the TITLE attribute information on links.
Most screen reading software can access TITLE attribute content on form controls by default.
Some screen reading software cannot access TITLE attribute information.
Users of screen magnifiers can read TITLE attribute text at lower magnification levels.
Users of screen magnifiers cannot read TITLE attribute text, that contains more than 1 or 2 words, at higher magnification levels.
Here's good piece of advice, better put than I could
Use this to provide additional information that is not essential. Most visual browsers display title text as a tool tip when the element is hovered over, however it is up to the browser manufacturer to decide how the title text is rendered. Some will display the text in the status bar instead. Early versions of Safari did this, for instance.
One good use of the title attribute is to add descriptive text to links, especially if the link text itself doesn’t clearly describe the link’s destination. This way you can help visitors know where the link will take them, possible saving them from loading a page only to find out it wasn’t anything they’re interested in. Another potential use is to provide additional information for an image, like maybe a date or other information that is likely not essential.
Remember that the longdesc attribute is supposed to be a link to further information, not text as some people missuse it.
I think the best practise is to put same content in alt and title attributes.
Regarding 'what to write' - just simple, in few words what is on the picture.
Check this article where alt attributes are described pretty well: http://www.cs.tut.fi/~jkorpela/html/alt.html