Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8644173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:13:48+00:00 2026-06-12T12:13:48+00:00

(I’m interested in HTML 4.01 and HTML5, if there should be differences) Does the

  • 0

(I’m interested in HTML 4.01 and HTML5, if there should be differences)

Does the lang attribute on an img element apply to the src attribute, too? Or is it only for the alt and title attributes?

Example:

<img src="example.png" alt="a red foobar" lang="en" />

Is the image “example.png” considered to be in English? (think of screenshots of a forum thread, or a graphical representation of a word, or a scan of a document)

If it’s true, images with non-linguistic content would need to get lang="zxx". But that would apply to the alt/title attributes, too, which would be incorrect.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:13:49+00:00Added an answer on June 12, 2026 at 12:13 pm

    HTML 4.01 defines the lang attribute as specifying “the base language of an element’s attribute values and text content”, whereas HTML5 defines it as “the primary language for the element’s contents and for any of the element’s attributes that contain text”. The difference is apparently in the formulation only. The lang attribute specifies the language of alt and title attribute as well as other attributes that may contain prose text, as opposite to code-like values like URLs or style attributes, where (human) language is not applicable.

    The src attribute itself is not of any (human) language, logically. So the question is whether the lang attribute extends to the image denoted by the src attribute. This is a fairly theoretical question – what impact on software behavior could the answer possibly have? Anyway, the answer depends on what we understand as “text content” (images are text in a sense, in formatting, but probably HTML 4.01 means to refer to actual character data only) and as “element’s contents” (is an image part of the img element’s contents?). Overall, it seems that the language of the image (though a feasible concept) cannot be specified in HTML.

    So there is no need to worry about images with non-linguistic content. For text content that is “non-linguistic” (i.e. not text in any human language but e.g. some code notation, or a random sequence of character), using lang="" is what HTML5 recommends. It’s also the practical approach. In the few cases whete lang attribute has any impact, as in automatic hyphenation, lang="" effectively means that no language rules are applied (e.g., no hyphenation). This is different from omitting the attribute, which means that the element inherits language information from its parent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to show the soap response to UIWebview.. my soap response is, <p><img
I know there's a lot of other questions out there that deal with this
I'm trying to select an H1 element which is the second-child in its group
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.