What is the correct XHTML for an attribute and its value?

  1. WIDTH="80"

  2. width="80"

  3. width=80

  4. Width=80


Correct Option: B

AI Explanation

To answer this question, you need to understand the correct syntax for attributes and their values in XHTML.

Option A) WIDTH="80" - This option is incorrect because attribute names in XHTML are case-sensitive. The correct casing for the attribute "width" is lowercase.

Option B) width="80" - This option is correct because it follows the correct syntax for attributes and their values in XHTML. In XHTML, attribute names are lowercase, and their values are enclosed in double quotation marks.

Option C) width=80 - This option is incorrect because attribute values in XHTML should be enclosed in double quotation marks. Without the quotation marks, the value is considered a number or a string, rather than a valid attribute value.

Option D) Width=80 - This option is incorrect because attribute names in XHTML are case-sensitive. The correct casing for the attribute "width" is lowercase.

The correct answer is B) width="80". This option is correct because it follows the correct syntax for attributes and their values in XHTML, with the attribute name in lowercase and the value enclosed in double quotation marks.

Find more quizzes: